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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploading files

Status
Not open for further replies.

Phonez

Technical User
Jan 16, 2002
58
GB
Does anyone know how to upload a file from a users computer onto the web server.

I am trying to do this so I can send the file as an attachment to an email address.

All of the scripts that I have seen on the web do not appear to work.

Any help appreciated
 
I've been trying the posting acceptor which seems to work fine for uploading a single file. Try to read the MS articles at

Use the following form format to upload your file :

<FORM method=&quot;POST&quot; action=&quot; id=fileform name=fileform enctype=&quot;multipart/form-data&quot;>

<INPUT type=&quot;hidden&quot; name=&quot;TargetURL&quot; value=&quot;
<INPUT type=&quot;file&quot; name=&quot;MyFile&quot;>

<INPUT TYPE=&quot;Submit&quot; VALUE=&quot;Submit&quot;>
</FORM>

The cpshost.dll should be installed on your web server (run the setup when you download the posting acceptor from the MS site) and handles the file upload itself. Once the file upload is complete, the URL after ?PUBLISH? is loaded. This ASP page can still access the field properties of your form (including the non-file fields, if any). It's actually the final processing and output page that is displayed after the form submission.

Myfiles should be a virtual directory on your webserver that is linked to a path on your server's HDD. Make sure the users have read/write access to this directory or they won't be able to upload anything.

Hope this helps. Let me know if you have any problems with this code.

Tim
 
Unfortunately I can't find the file that you have to download from microsoft, it has been removed from the download center.

Any other ways of doing it?
 
You're right, it must have been removed last week (I downloaded it only two weeks ago). If you wish I could send it to you by email, but I guess it should come back online in a while (I don't know why Microsoft removed it in the first place).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top