how to upload a file to my server using html

前端 未结 3 1948
感动是毒
感动是毒 2020-11-30 07:12

basically i have this form that allows user to upload to my server:

相关标签:
3条回答
  • 2020-11-30 07:42

    On top of what the others have already stated, some sort of server-side scripting is necessary in order for the server to read and save the file.

    Using PHP might be a good choice, but you're free to use any server-side scripting language. http://www.w3schools.com/php/php_file_upload.asp may be of use on that end.

    0 讨论(0)
  • 2020-11-30 07:43
    <form id="uploadbanner" enctype="multipart/form-data" method="post" action="#">
       <input id="fileupload" name="myfile" type="file" />
       <input type="submit" value="submit" id="submit" />
    </form>
    

    To upload a file, it is essential to set enctype="multipart/form-data" on your form

    You need that form type and then some php to process the file :)

    You should probably check out Uploadify if you want something very customisable out of the box.

    0 讨论(0)
  • 2020-11-30 07:55

    You need enctype="multipart/form-data" otherwise you will load only the file name and not the data.

    0 讨论(0)
提交回复
热议问题