Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to upload a file to my server using html

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

<form id = "uploadbanner" method = "post" action = "#">       <input id = "fileupload" type = "file" />       <input type = "submit" value = "submit" id = "submit" /> </form> 

But the problem is that when i upload a file, then click submit, i don't see the file upload in the server directory.

like image 200
dave Avatar asked Apr 11 '11 21:04

dave


People also ask

How do you upload a file to a website using HTML?

HTML allows you to add the file upload functionality to your website by adding a file upload button to your webpage with the help of the <input> tag. The <input type=”file”> defines a file-select field and a “Browse“ button for file uploads.

How do I upload a file to my server?

Right-click the folder and select “Upload other file here. . .“. Browse the server for the file you want to upload. Select the file and click Open. Now, you will see the file in the folder location on the server.

How do you add an attachment in HTML?

Right-click in the attachment pool, and choose Add from the menu that appears. In the Add Attachment dialog box, navigate to the appropriate location and open the file.


1 Answers

<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.

like image 75
Calum Avatar answered Sep 22 '22 06:09

Calum