Connecting Tech Pros Worldwide Help | Site Map

input type=file

Member
 
Join Date: Feb 2007
Posts: 95
#1: Oct 14 '09
I need to allow users to upload files that support an online application. I am using input type=file to gather the path on the user's computers. How can I upload the file they specify after I have verified the file type? And, how can I indicate the destination folder on my server?
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,126
#2: Oct 16 '09

re: input type=file


you might have a look here for a quickstart ...

kind regards
Newbie
 
Join Date: Sep 2009
Posts: 1
#3: Oct 17 '09

re: input type=file


This can't be done just by JavaScript. You need to have a server side processing script like PHP or ASP. For an example in PHP, see the page below:
Email form with file attachment in PHP
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: 3 Weeks Ago

re: input type=file


If you do need to upload without a page unload, use an iframe.
Member
 
Join Date: Feb 2007
Posts: 95
#5: 3 Weeks Ago

re: input type=file


What is iframe? I am adding this sentence because my reply was too short to post.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#6: 3 Weeks Ago

re: input type=file


Quote:

Originally Posted by andersond View Post

What is iframe? I am adding this sentence because my reply was too short to post.

http://www.google.com/search?source=...=f&oq=&aqi=g10
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#7: 3 Weeks Ago

re: input type=file


Here's one example of a file upload using an iframe.
Reply