Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileUpload questions

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have been requested by the bossman to put a file submission form into one of our company webpages. I've been looking for information about this and I've found nothing.

What's the correct process for this? I assume that this is done with Javascript, as pulling files off a client's machine with a server-side language seems pretty insecure.

I was under the impression that just making an HTML form with a element of type "file" and then submitting the form would take care of it, but that doesn't seem to do it...

Any help would be appreciated. Thanks.

-brendan
 
Hey Brendan (good name),

To handle file uploads, there are a couple things you need to specify in the html. The first one you got right -- an input type='file'. You also need to set the form's encoding to multipart/form-data and set the method to post(the get method only allots a few kb for form data). So, simply use <form enctype='multipart/form-data' method='post'>. As far as the server side languages go .. They're vital for the uploaded file processing and organization (checking to make sure it's a valid file, placing the file in a user's specific directory, etc). I'd recommend PHP.. but as a lecturer on the language, I have a very strong bias toward it.

So.. nope. Not done with Javascript.

Good luck,

brendanc@icehouse.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top