Page 9 of 9 First ... 789
  • Jump to page:
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2014
    Posts
    4
    Rep Power
    0
    Thanks for the quick reply Shadow...

    I haven't tried yet but my fear is that the file indexes won't match up say if the 1st file is empty...

    1 becomes 0 at that point:

    objUpload.File(1).SaveToDisk(Server.MapPath(strPat h), "")

    I really don't think it will work but I will give it a try when I get to work this afternoon.
  2. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2926
    Originally Posted by jmhenry5150
    Thanks for the quick reply Shadow...

    I haven't tried yet but my fear is that the file indexes won't match up say if the 1st file is empty...

    1 becomes 0 at that point:

    objUpload.File(1).SaveToDisk(Server.MapPath(strPat h), "")

    I really don't think it will work but I will give it a try when I get to work this afternoon.
    Yes that's my fear too so when you try let me know and if indeed our fears will come true I will find time to reproduce and solve this. My code, my problem after all.
  3. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2014
    Posts
    4
    Rep Power
    0
    Ok so I did a quick test in my post file:

    response.write "TeamImageNew: " & objUpload("TeamImageNew") & "<br>"
    response.write "TeamHeaderNew: " & objUpload("TeamHeaderNew") & "<br><br>"

    response.write "TeamImageNew: " & objUpload.File(0).FileName & "<br>"
    response.write "TeamHeaderNew: " & objUpload.File(1).FileName

    And my fears were confirmed.

    If the 1st image is blank, the file names got out of sync because the indexes didn't match...

    Help!
  4. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2926
    After giving it some thought, I understood your case is very specific and don't require and code change in the level of the uploader itself.

    As far as I can see and tell, what you need is to check all possible scenarios:

    Code:
    If Len(objUpload("first_file"))>0 And Len(objUpload("second_file"))>0 Then
    	Response.Write("Both files were uploaded<br />")
    	Response.Write("Name of the first file: " &  objUpload.File(0).FileName & "<br />")
    	Response.Write("Name of the second file: " &  objUpload.File(1).FileName & "<br />")
    	Call objUpload.File(0).SaveToDisk(Server.MapPath(strPath), "")
    	Call objUpload.File(1).SaveToDisk(Server.MapPath(strPath), "")
    ElseIf Len(objUpload("first_file"))>0 Then
    	Response.Write("Only first file was uploaded, second left blank<br />")
    	Response.Write("Name of the first file: " &  objUpload.File(0).FileName & "<br />")
    	Call objUpload.File(0).SaveToDisk(Server.MapPath(strPath), "")
    ElseIf Len(objUpload("second_file"))>0 Then
    	Response.Write("Only second file was uploaded, first left blank<br />")
    	Response.Write("Name of the second (and only) file: " &  objUpload.File(0).FileName & "<br />")
    	Call objUpload.File(0).SaveToDisk(Server.MapPath(strPath), "")
    Else  
    	Response.Write("No files were chosen for upload<br />")
    End If
    So, what you think?
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2014
    Posts
    4
    Rep Power
    0
    That should work!

    I will let you know
  6. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jun 2014
    Posts
    4
    Rep Power
    0
    URGENT Help with this script please



    i have the shadow uploader also and works great for the 5 form fields (added 2 from original code) in the exmple but want 11, as soon as i add an extra field i get an error :

    Request object error 'ASP 0104 : 80004005'
    Operation not Allowed
    /a20couk/includes/ShadowUploader.asp, line 56

    here is my extra code the shadowuploader include remains the same:

    <!-- #include file="../../includes/ShadowUploader.asp" -->
    <%
    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("../../tempuloads/"), "")
    Response.Write("file saved successfully!")
    End If
    Response.Write("<hr />")
    Next
    Response.Write("thank you, "&objUpload("name"))
    End If
    End If
    %>
    <form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1" enctype="multipart/form-data" method="POST">
    File1: <input type="file" name="file1" /><br />
    File2: <input type="file" name="file2" /><br />
    File3: <input type="file" name="file3" /><br />
    File4: <input type="file" name="file4" /><br />
    File5: <input type="file" name="file5" /><br />
    File6: <input type="file" name="file6" /><br />
    File7: <input type="file" name="file7" /><br />
    File8: <input type="file" name="file8" /><br />
    File9: <input type="file" name="file9" /><br />
    File10: <input type="file" name="file10" /><br />
    File11: <input type="file" name="file11" /><br />
    Name: <input type="text" name="name" /><br />
    <button type="submit">Upload</button>
    </form>

    been tearing hair out as cchanged alot of settings one by one nothing worked, will lose all my hair if not resolved quickly!!

    Thanks
    Sidling
  7. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2926
    Originally Posted by Sidling
    i have the shadow uploader also and works great for the 5 form fields (added 2 from original code) in the exmple but want 11, as soon as i add an extra field i get an error :

    Request object error 'ASP 0104 : 80004005'
    Operation not Allowed
    /a20couk/includes/ShadowUploader.asp, line 56
    Weird, looks like the script is executed twice somehow. Luckily I've added option to debug. There is this line in ShadowUploader.asp:

    Const SU_DEBUG_MODE=False

    Please change the line to this:

    Const SU_DEBUG_MODE=True

    And post here the output you will see before the error happens, e.g.messages like "initializing upload, bytes: " and likely more.
  8. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jun 2014
    Posts
    4
    Rep Power
    0
    Originally Posted by Shadow Wizard
    Weird, looks like the script is executed twice somehow. Luckily I've added option to debug. There is this line in ShadowUploader.asp:

    Const SU_DEBUG_MODE=False

    Please change the line to this:

    Const SU_DEBUG_MODE=True

    And post here the output you will see before the error happens, e.g.messages like "initializing upload, bytes: " and likely more.
    the setting was done for debugging it does not make a difference if true or false, as sson as o go oer 5 upload fields i get the same error!

    thanks for coming back btw
  9. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2926
    Originally Posted by Sidling
    the setting was done for debugging it does not make a difference if true or false, as sson as o go oer 5 upload fields i get the same error!

    thanks for coming back btw
    Cheers, will try to reproduce and see what's going on. Ping me if I'm not coming back in a day.
  10. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2926
    Originally Posted by Sidling
    the setting was done for debugging it does not make a difference if true or false, as sson as o go oer 5 upload fields i get the same error!

    thanks for coming back btw
    Posted a full reply here: vbscript - Can anyone help me with this shadow upload script? - Stack Overflow
Page 9 of 9 First ... 789
  • Jump to page:

Similar Threads

  1. Upload Script with HTTPget
    By comix2000 in forum ASP Development
    Replies: 1
    Last Post: January 20th, 2005, 07:50 PM
  2. Hot Or Not Script Upload Error
    By marya in forum ASP Development
    Replies: 5
    Last Post: October 14th, 2004, 09:12 PM
  3. Huge / Pure upload?
    By fatmanman in forum ASP Development
    Replies: 0
    Last Post: September 14th, 2004, 07:20 AM
  4. Replies: 2
    Last Post: August 27th, 2004, 04:58 PM
  5. Upload script
    By kutty in forum ASP Development
    Replies: 0
    Last Post: October 1st, 2003, 04:36 PM

IMN logo majestic logo threadwatch logo seochat tools logo