Forum Moderators: open

Message Too Old, No Replies

All I want to do is upload files!

         

snowmansmartie

12:54 pm on Aug 5, 2006 (gmt 0)

10+ Year Member



Hi,

I am developing a website where people will be able to upload files to their own sub folder on the server to be downloaded by other users. However, this is turning out to be the worst 2 days of my life, yes thats how long I have been fighting this thing for!

Right am going to include the code for both pages and I need to see if anyone can see why it does not work, orwhat I am missing.

Form
----


<form id="upload" name="upload" method="POST" action="li_resources_head.asp" enctype="application/x-www-form-urlencoded">
File to upload<input type="file" name="filename" />
<input type="submit" name="Submit" value="Uload" />
</form>

Upload page (li_resources_head.asp)
-----------

uid = Session("SysUserLoginName")
fup = request.Form("filename")
response.Expires = 0
Set fbase = Server.CreateObject("Chili.Upload.1")
fbase.SizeLimit = 100000
fbase.SaveToFile(server.MapPath("../businessballs/" & uid & "/" & fup))

The error I get is:


Chili.Upload.1 (0x80004005)
Form does not contain a file element.
/businessballs/li_resources_head.asp, line 33

This is starting to drive me insane!

I am probably missing something sooooo obvious, but after staring at this code for nearly 2 days I'm not surprised!

Thanks in advance (and please make answers simple, I'm too tired to try and understand anything complicated LOL! :> )

aspdaddy

3:04 pm on Aug 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are just uploading the filename, not the actual file.

Add ENCTYPE="multipart/form-data" to the form, and have a good read of the upload components documentation on how to do it,as they are all different.

fup = request.Form("filename")

With the one I use, this wont work. you have to do this insead:

objUploader=New Uploader()
fup = objUploader.Upload("filename)