Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Problem with uploading with image + text box field

Problem with uploading with image + text box field

Scheduled Pinned Locked Moved Web Development
helptoolsquestion
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imthias007
    wrote on last edited by
    #1

    Hi, I have a form with two text box and one browse button and a submit button .on action page2 . the code which i have is uploading script ( for the image to get uploaded) . So i need the text box value to be displayed on the action page2. how can i do it. but i tried the property using name= Request.Form("title") and stored in an variable. and then used the Response.Write("name") . but it shows an error stating that binary method is called so i can't use the request method r response method . how am i going to solve this . Wat is the alternative method to do it . so that i can upload my image as well as i can display my contents of the text box . Plz help me i am new to this kind of concept . if needed i will send the file too. imthi

    P G 2 Replies Last reply
    0
    • I imthias007

      Hi, I have a form with two text box and one browse button and a submit button .on action page2 . the code which i have is uploading script ( for the image to get uploaded) . So i need the text box value to be displayed on the action page2. how can i do it. but i tried the property using name= Request.Form("title") and stored in an variable. and then used the Response.Write("name") . but it shows an error stating that binary method is called so i can't use the request method r response method . how am i going to solve this . Wat is the alternative method to do it . so that i can upload my image as well as i can display my contents of the text box . Plz help me i am new to this kind of concept . if needed i will send the file too. imthi

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      I can't quite understand what you are trying to do, but you might want to take a look at this: http://www.codeproject.com/aspnet/fileupload.asp[^]

      I 1 Reply Last reply
      0
      • P Paddy Boyd

        I can't quite understand what you are trying to do, but you might want to take a look at this: http://www.codeproject.com/aspnet/fileupload.asp[^]

        I Offline
        I Offline
        imthias007
        wrote on last edited by
        #3

        hi, Actually i have a file called addnews.asp , for your referal you can go to this url http:www.focus.com.sg/asp/addnews.asp in this page i need to upload the image and the text box content. Now my problem is i have downloaded the from google the image uploading scripts. the page is named as uploadDest.asp ( where the script works fine for uploading the image) but my requirement is those text box value also have to recieved from the second page . which is the action page uploadDest.asp But when i use request.form("title") then it shows me an error sayin that request could not be used when Binary method is called. Can you provide me a solution on this plzzzzz imthi

        A 1 Reply Last reply
        0
        • I imthias007

          hi, Actually i have a file called addnews.asp , for your referal you can go to this url http:www.focus.com.sg/asp/addnews.asp in this page i need to upload the image and the text box content. Now my problem is i have downloaded the from google the image uploading scripts. the page is named as uploadDest.asp ( where the script works fine for uploading the image) but my requirement is those text box value also have to recieved from the second page . which is the action page uploadDest.asp But when i use request.form("title") then it shows me an error sayin that request could not be used when Binary method is called. Can you provide me a solution on this plzzzzz imthi

          A Offline
          A Offline
          Aslam Bari
          wrote on last edited by
          #4

          There are many alternate ways:- I am not sure why that is not working. If you still want to show something on next page try one of the followings:- 1. I am not sure but on the next page FILE[] method will be available 2. Use Session Variables to store what you want in textbox 3. Added the variable to QueryString ? 4. Use database query to show information on next page.

          I 1 Reply Last reply
          0
          • A Aslam Bari

            There are many alternate ways:- I am not sure why that is not working. If you still want to show something on next page try one of the followings:- 1. I am not sure but on the next page FILE[] method will be available 2. Use Session Variables to store what you want in textbox 3. Added the variable to QueryString ? 4. Use database query to show information on next page.

            I Offline
            I Offline
            imthias007
            wrote on last edited by
            #5

            hi, As per the above your question 1. the next page what i have this below script the action page:UploadDest.asp and the below script is the code which has and its working fine when i upload the image. --- this script below i downloaded from google site ------- <% response.buffer = true 'in my tests, this seems to increase speed a bit set oUpload = server.createobject("ASPUpLoad.clsUpload") 'If nothing's entered, the .dll will save the file 'in the same path in which it resides, with the 'file name entered by the user 'THIS SAVES TO SAME DIRECTORY THE WEB PAGE IS IN 'MAKE SURE WEB USER HAS WRITE ACCESS 'TO THIS DIRECTORY (OR WHATEVER DIRECTORY YOU 'CHOOSE FOR SAVING). OTHERWISE, AN ERROR WILL OCCUR oUpload.Path = Server.MapPath(".") 'Don't worry if user leaves FileName blank. 'the dll will just save it as the file 'selected. if oUpload.Form("SaveAs") <> "" then 'get rid of any "\" chars, because we are 'setting path above. But you can set full 'path with this property to. sSplit = split(oUpload.Form("SaveAs"), "\") sFileName = sSplit(ubound(sSplit)) 'if user has specified a file type 'use that, otherwise, we will just take what's 'given if oUpload.Form("FileType") <> "Other" then if instr(sFileName, ".") > 0 then sSplit = split(sFileName, ".") sFileName = sSplit(0) & "." & oUpload.Form("FileType") else 'file type doesn't actually convert one file type to 'another. This is just used as an illustration 'of the Form Object. sfileName = sFileName & "." & oUpload.Form("FileType") end if End if oUpload.FileName = sFileName End if bAns = oUpload.Save %> FreeVBCode.com ASP Upload Example

            ASP Upload Results

            <% if bAns = true then %> The uploaded file was successfully saved to the host machine as <%= oUpload.Path & oUpload.FileName%>

            In addition, the following information was obtained from the submitting form:

            <% set objFormDetails = oUpload.FormDetails lCount = objFormDetails.Count for lCtr = 1 to lCount Response.write "Key: " & objFormDetails.Key(lCtr) & " Value: " & objFormDetails.Item(lCtr) & "
            " Next %> <% else %> No file was saved due to the following reason: <%= oUpload.Error %> <% end if set oUpload = nothing %> ---------------------------- end of above script ----------------- But my main concern is how am i going to get th

            1 Reply Last reply
            0
            • I imthias007

              Hi, I have a form with two text box and one browse button and a submit button .on action page2 . the code which i have is uploading script ( for the image to get uploaded) . So i need the text box value to be displayed on the action page2. how can i do it. but i tried the property using name= Request.Form("title") and stored in an variable. and then used the Response.Write("name") . but it shows an error stating that binary method is called so i can't use the request method r response method . how am i going to solve this . Wat is the alternative method to do it . so that i can upload my image as well as i can display my contents of the text box . Plz help me i am new to this kind of concept . if needed i will send the file too. imthi

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              There is nothing in the Request.Form collection, as the upload component has already consumed the form data to get the uploaded file. You have to get the form data from the upload component. Most components have a Form collection for this purpose that works like Request.Form.

              --- b { font-weight: normal; }

              R 1 Reply Last reply
              0
              • G Guffa

                There is nothing in the Request.Form collection, as the upload component has already consumed the form data to get the uploaded file. You have to get the form data from the upload component. Most components have a Form collection for this purpose that works like Request.Form.

                --- b { font-weight: normal; }

                R Offline
                R Offline
                rmccoll
                wrote on last edited by
                #7

                With ASPUpload, the .Form collection does not get populated until AFTER the .Save method has been called. So trying to reference it before will not return any results. :)

                G 1 Reply Last reply
                0
                • R rmccoll

                  With ASPUpload, the .Form collection does not get populated until AFTER the .Save method has been called. So trying to reference it before will not return any results. :)

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  Correct. Considering the error message that the OP is getting, though, it appears that he either is not using ASPUpload, or has already called the Save method. With ASPUpload, the data is available through Request.Form before the Save method is called. Of course, if the data is read using Request.Form, the Save method can't be used after that. Some upload components handle the data automatically when they are created, other, like ASPUpload, handles the data upon a method call.

                  --- b { font-weight: normal; }

                  R 1 Reply Last reply
                  0
                  • G Guffa

                    Correct. Considering the error message that the OP is getting, though, it appears that he either is not using ASPUpload, or has already called the Save method. With ASPUpload, the data is available through Request.Form before the Save method is called. Of course, if the data is read using Request.Form, the Save method can't be used after that. Some upload components handle the data automatically when they are created, other, like ASPUpload, handles the data upon a method call.

                    --- b { font-weight: normal; }

                    R Offline
                    R Offline
                    rmccoll
                    wrote on last edited by
                    #9

                    I would agree, but accoring to the previously posted script (excerpt: response.buffer = true 'in my tests, this seems to increase speed a bit set oUpload = server.createobject("ASPUpLoad.clsUpload") ) It looks like he is using ASPUpload. But noticing the comment right before "--- this script below i downloaded from google site -------", I might have been assuming too much.

                    G 1 Reply Last reply
                    0
                    • R rmccoll

                      I would agree, but accoring to the previously posted script (excerpt: response.buffer = true 'in my tests, this seems to increase speed a bit set oUpload = server.createobject("ASPUpLoad.clsUpload") ) It looks like he is using ASPUpload. But noticing the comment right before "--- this script below i downloaded from google site -------", I might have been assuming too much.

                      G Offline
                      G Offline
                      Guffa
                      wrote on last edited by
                      #10

                      Current versions (3.x) of the AspUpload[^] component uses the progid "Persits.Upload". Perhaps he is using an old version (1.x?) of AspUpload?

                      --- b { font-weight: normal; }

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups