deucalion0
deucalion0

Reputation: 2440

Can I upload a file to my server using a form and POST in HTML?

I want to create a way that people can upload images to an images folder on my server using an HTML form and the input type file, I thought that the only way it was ever possible to add a file to my server was to FTP in there and drag it in. Is there a straight forward way I could create a form that would allow someone to select an image and just upload it to my folder?

Upvotes: 0

Views: 115

Answers (4)

David Richard
David Richard

Reputation: 356

Pretty straight forward example from w3schools. Comes with an example HTML and PHP script

http://www.w3schools.com/php/php_file_upload.asp

Upvotes: 1

Kenneth Funk
Kenneth Funk

Reputation: 396

You are going to need some type of script on the server to handle the file. I know that you can google for and find at least a couple of PHP scripts because I had to do it a few years ago. The script can also be useful in that it can change the name of the file so that duplicate files do not overwrite each other.

Sample upload script

Upvotes: 1

Jeremy D
Jeremy D

Reputation: 4855

You could find more information here : http://www.php.net/manual/en/features.file-upload.post-method.php

Upvotes: 1

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324690

See POST method uploads for an introduction. There are plenty of file upload examples on Google.

Upvotes: 1

Related Questions