Page 5 of 9 First ... 34567 ... Last
  • Jump to page:
    #61
  1. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
  2. #62
  3. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0
    sorry, i've typed a wrong link, the right one is without "/html"
  4. #63
  5. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by TriVector
    sorry, i've typed a wrong link, the right one is without "/html"
    still no luck. getting the attached error message.

    looks like the problem is not with the upload code but with the
    image itself.... how did you build it?

    how can you view it?
    Attached Images
  6. #64
  7. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0
    i've put both of them into a zip file, hope it works.

    www . chinaklang . com / Down / error.zip

    many thanks!!!
  8. #65
  9. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by TriVector
    i've put both of them into a zip file, hope it works.

    www . chinaklang . com / Down / error.zip

    many thanks!!!
    yes I got it now.
    sorry, wasn't able to reproduce your problem.
    I was able to view and open both the files with no problem.
    I then uploaded the files and tried to view and open the new files: no problem.
    looks like it's problem with your personal computer, consider posting in the
    Windows OS forum with more details. (as far as I can see, it's not related to ASP)
  10. #66
  11. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0
    many Thanks, i'll find what's going on with my computer
  12. #67
  13. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2006
    Posts
    8
    Rep Power
    0

    image to big, not saving!


    Sorry i figured it out
    Last edited by sam2006; April 22nd, 2009 at 05:17 PM. Reason: SOLVED
  14. #68
  15. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Nov 2003
    Posts
    111
    Rep Power
    15
    can I use this to upload a file and then save the name to a hidden field within my registration form?
    is that possible?
  16. #69
  17. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by esthera
    can I use this to upload a file and then save the name to a hidden field within my registration form?
    is that possible?
    not sure what you're asking, will try to split your question.
    can I use this to upload a file
    yes, using the code you can upload file from the client machine to
    the server and save that file on the server disk.

    and then save the name
    yes you can know the file name (IE give full path, Firefox only the name of the file,
    no full path) and with the name you can do whatever you want.

    to a hidden field within my registration form
    here I've lost you. what do you mean "save to hidden field"? what form?
    after the file was uploaded, ASP code is executed. you should put message
    like "file uploaded successfully" or "failed to upload".
    by the time the file was uploaded, there is no longer form, unless you put
    brand new form after the one used to upload the file.
  18. #70
  19. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Nov 2003
    Posts
    111
    Rep Power
    15
    I meant uploading the file without submitting the form and then updating a hidden field value on the form.
    I'm trying to work on a iframe solution now.
  20. #71
  21. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by esthera
    I meant uploading the file without submitting the form and then updating a hidden field value on the form.
    I'm trying to work on a iframe solution now.
    you'll need some sort of AJAX for this.. the form has to be submitted somehow,
    you can make it "silent" by using client side JavaScript. if you add iframe to your
    page you can change the form "target" attribute to the name of the frame
    and when submitted, it will be silent and the user will stay in the page. it's not
    going to be simple but it's possible. to send the file name to the parent page have
    such code in the ASP:
    Code:
    Set objUpload=New ShadowUpload
    If objUpload.GetError<>"" Then
    		Response.Write("sorry, could not upload: "&objUpload.GetError)
    Else  
    	If To objUpload.FileCount=0 Then
    		Response.Write("no file selected")
    	Else  
    		Call objUpload.File(0).SaveToDisk(Server.MapPath("Uploads"), "")
    		Response.Write("<script type=""text/javascript""> parent.document.getElementById(""MyFile"").value = """ & objUpload.File(x).FileName & """; </script>")
    	End If
    this will upload the file and send client side script for setting the text box value.
    for the above to work, you'll have to add id "MyFile" to the text box, of course
    you can have different id and change the code accordingly.
  22. #72
  23. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2008
    Posts
    21
    Rep Power
    0
    I really hope people still read this thread!

    I've got the code working, so first of all thanks so much it was easy and works amazingly!

    I have a slight problem though that may or may not be curable...
    ive got the code sitting in a folder called 'staff' where all the site maintenance pages sit. however i want the images to be uploaded to a directory lower down in the structure, ie the code is sitting at https://www.site.com/staff/upload.asp but i want the images to go to http://www.site.com/images

    I don't want the images in the staff section, partly because i want them on the same level as the rest of the customer pages, but also because the directory 'staff' as a whole is set so it needs to be viewed over https, whereas the customer level of the site isnt, so really i need them to go to ../images
    I tired to amend the location in the code, but it says that '..' isnt allowed as a location, and i also tried the full address (ie http://www.site.com/images) but it didnt like that either.

    Is it possible to send the files to the lower level, non secure directory at all?
  24. #73
  25. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    have you tried this?
    Code:
    Call objUpload.File(0).SaveToDisk(Server.MapPath("/images/"), "")
    if so, what happens when you have it?
  26. #74
  27. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2010
    Posts
    1
    Rep Power
    0

    Question I need help


    I'm trying to pass imagename as a parameter in the url, so that in can use it in a form that inserts the imagename & other data into the database.

    Code:
    <form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1&filename=<%=strNewFileName%>" enctype="multipart/form-data" method="POST">
    But it doesn't work

    It is my first time here. Thanks.
  28. #75
  29. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by WolverineHD
    I'm trying to pass imagename as a parameter in the url, so that in can use it in a form that inserts the imagename & other data into the database.

    Code:
    <form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1&filename=<%=strNewFileName%>" enctype="multipart/form-data" method="POST">
    But it doesn't work

    It is my first time here. Thanks.
    what do you mean "it doesn't work"?
    I need more details if you want help:
    1. what is the variable "strNewFileName" and where is it defined? please post relevant code.
    2. how do you try to read the file name you're passing? please post relevant code.
Page 5 of 9 First ... 34567 ... Last
  • 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