Discuss ShadowUploader - help implementing the code in the ASP Development forum on ASP Free. ShadowUploader - help implementing the code 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.
i have no probs with the script, it works fine, but i want to be able to upload an image aswell as data (text) from the same page, i've had probs trying to do this as i get an error, cn't remember the error.
can this be done?
__________________
Everyone has a photographic memory. Some don't have film.
I am a nobody, nobody is perfect, therefore I am perfect.
Last edited by Shadow Wizard : June 13th, 2006 at 08:37 AM.
Posts: 31,109
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
yes and the original example I posted contains uploading both image and text - it print
"thank you, [name here]" where the [name here] is text entered by the user in the form.
post error message and relevant code and hopefully we can sort it out..
Posts: 3,397
Time spent in forums: 2 Weeks 5 Days 12 h 38 m 38 sec
Reputation Power: 554
ok well i could i do this then:
Code:
<%
Dim objUpload
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 />")
Response.Write("image width: "&objUpload.File(x).ImageWidth&"<br />")
Response.Write("image height: "&objUpload.File(x).ImageHeight&"<br />")
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
Response.Write("<hr />")
Next
can i create a recordset to INSERT INTO here?
End If
End If
%>
Posts: 3,397
Time spent in forums: 2 Weeks 5 Days 12 h 38 m 38 sec
Reputation Power: 554
Hi Shadow
i've probably done something wrong..
my code:
Code:
'Response.Write(Server.MapPath("../productImages"))
'Response.End()
Dim objUpload
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 />")
Response.Write("image width: "&objUpload.File(x).ImageWidth&"<br />")
Response.Write("image height: "&objUpload.File(x).ImageHeight&"<br />")
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("../productImages"), "")
Response.Write("file saved successfully!")
End If
Response.Write("<hr />")
Next
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
'strAddSub = "SELECT * FROM tblCategorys WHERE catID = " & Request.Form("catID") & ""
'Set rsAddSub = Server.CreateObject("ADODB.Recordset")
'rsAddSub.Open strAddSub,Conn
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
'strSQL = "UPDATE tblSubCat SET [catID] = " & Request.Form("catID") & ", [catName] = '" & rsAddSub("catName") & "', [subCatName] = '" & Request.Form("subName") & "', [description] = '" & Request.Form("description") & "', [theDate] = #" & Now() & "# WHERE [subID] = " & Request.Form("subID") & ""
'Conn.Execute strSQL
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
'rsAddSub.Close
'set rsAddSub = Nothing
response.redirect "loggedin.asp?" & Session("uid") & ""
End If
the error:
Code:
Technical Information (for support personnel)
* Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'MidB'
/plastitrade/admin074/ShadowUploader.asp, line 94
* Browser Type:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
* Page:
POST 88 bytes to /plastitrade/admin074/addProduct3.asp
* POST Data:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Server.HTMLEncode'
/iisHelp/common/500-100.asp, line 194
i really need your help on this, i'm on a tight deadline, thanks Shadow
Posts: 31,109
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
hmm... I fear you stumbled on file my code can't "eat" for some reason.
I'll PM you with my email, please send the file and I'll try to fix that.
as I can't promise that I'll be able to do that, and since you need to upload
"ordinary" files (not images) I recommend you'll use the ordinary upload script: http://www.asp101.com/articles/jacob/scriptupload.asp
Posts: 31,109
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
if it's image you can attach it here - what you sent me had no problem though.
so far there were 2 files (both .doc files) that caused that error you mentioned
and I was not able to resolve the problem. however for all the files I tried it
works fine so maybe another "bad" file will help me solve this.
Posts: 1
Time spent in forums: 13 m 28 sec
Reputation Power: 0
ASP file upload
Hi,
can anyone please help to upload an heavy file of around more than 20kb on server using asp. Please this is an very urgent need,
Quote:
Originally Posted by shem
(regarding this thread: URL)
Hi Shadow
i have no probs with the script, it works fine, but i want to be able to upload an image aswell as data (text) from the same page, i've had probs trying to do this as i get an error, cn't remember the error.