Shadow Uploader - uploading any file (not only images)
Discuss Shadow Uploader - uploading any file (not only images) in the ASP Development forum on ASP Free. Shadow Uploader - uploading any file (not only images) ASP Development forum discussing ASP related topics including coding practices, ASP tips, and more. Active Server Pages (ASP) enables you to empower your HTML pages dynamically with robust scripting options.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 3
Time spent in forums: 1 h 52 m 54 sec
Reputation Power: 0
Upload just native files of extension x,y,z
I like the upload script but want to simply upload some txt, mdb, xls and doc files.
Do you have a version that allows simply the upload of native docs that does not check for images and size of images?
Also, after I select UPLOAD, the results page show the browse buttons repeated. I would just like to show the results and then a button that hrefs to another asp page, is that possible and how?
you don't have to use all those features, the code can be used as ordinary upload script.
example of using it without any image related code:
Code:
If Request("action")="1" Then
Set objUpload=New ShadowUpload
If objUpload.GetError<>"" Then
Response.Write("sorry, could not upload: "&objUpload.GetError)
Else
Response.Write("found "&objUpload.FileCount&" files...<br />")
For x=0 To objUpload.FileCount-1
Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
Response.Write("file size: "&objUpload.File(x).Size&"<br />")
Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
Response.Write("file saved successfully!")
Response.Write("<hr />")
Next
Response.Write("thank you, "&objUpload("name"))
End If
End If
however, the code is not 100% stable as I got reports of certain files that could
not be uploaded. for general upload, as long as you also don't have to rename the
uploaded files, use this upload script: http://www.asp101.com/articles/jacob/scriptupload.asp
by the way how did you find this thread? couldn't find it on top of google results..
as for your second question, you can have such code:
Posts: 31,109
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
yes the only thing that prevent saving non image files are those lines:
Code:
If (objUpload.File(x).ImageWidth>200) Or (objUpload.File(x).ImageHeight>200) Then
Response.Write("image to big, not saving!")
Else
Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
Response.Write("file saved successfully!")
End If
change them to this for example and any file will be saved to disk: