Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with variable path - Persists Upload IIS 6.0

Status
Not open for further replies.

Cirrus9

IS-IT--Management
Aug 21, 2001
248
US
The purpose of my code is to allow a user to navigate to a (Folderview)folder, select "Upload" from a side menu and then allow them to upload a 10MB +/- to that folder. I set out to capture the path of the folder the user is in and then proceeded to send it to a second page where the user can choose a file to upload to that folder.

I pass the folder path as a renamed variable to a Persists Upload page (Because of the file size limitations in IIS 6.0 I found I can't use Binary. The only problem is I can't get the file to upload using the variable path I captured by using Upload.Save or Upload.SaveVirtual.

When I pass the path the first time I can view the variable but when I try to send it the second time through a hidden value using a second form, it won't pass. I know that I am getting the value to the second form successfully(I checked). I am using a Hidden Input Value to hold it.

I checked to see if the hidden value was retaining the variable correctly and it is. It just won't pass from the second form to the FORM ACTION page. I have the code below. I hope I included all of the relevant parts. Also, I am able to upload using standard paths (C:\*)
--------------------------------------------------------
ReCap of Goal

User goes to folder | Clicks Upload | Page appears to select file to upload | User Chooses File & Clicks Upload | File Uploads
-------------------------------------------------------
1) I passed the value of my First Form to my second form page. I received it and then renamed the variable before sending it on to my Upload form.

<% Dim Strpass
StrPass = request.form("Direct")%>


2) I passed the value to my Hidden Input

<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="Upload.asp">
<INPUT TYPE=FILE SIZE=60 NAME="FILE1"><BR>
<INPUT TYPE=HIDDEN Value="<%=StrPass%>" Name="PATH">
<INPUT TYPE=SUBMIT VALUE="Upload!">
</FORM>


3) My upload.asp page either gets error 500 (No friendly error showing)or acts like it worked (or Uploaded) and the file is not uploaded.
(upload.asp code below)

<%Response.Buffer = False
Dim NewPath
NewPath = request.form("Path")
Set Upload = Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual(NewPath)%>
<%= Count %> files were uploaded


Please let me know if I need to list more code. I tried to put the main parts for what I am trying to accomplish. Any help is greatly appreciated. I will clarify if I wasn't clear enough


 
the code you posted here looks good...

do reponse.write statements to see if all the variables are getting passed correctly..

post your complete code...

-DNG
 
I had response.write statements in the code to be sure they were passing correctly. I removed them in the post. The variable is passing except for the last page. The response.write statement returns nothing. I can't figure out why it won't work. It is a simple form value. I have tried resaving on a different page and a different page name (I've seen stranger things work). Nothing will work. I checked with the hosting company to see if there is a problem.............Nothing.


The relative code that I didn't post was from the first Form

<Form Name="Form1" Action="Saver.asp" Method="post">
<Input Type="Hidden" name="direct" value="<%=request.querystring("path")%>">
<Input Type="Submit" Value="Upload File"></Form>


Thanks for your help..
 
which variable are you talking about...

how are you getting

<%=request.querystring("path")%>...should not that be

<%=request.form("path")%> or

<%=request.querystring("newpath")%>

can you show relevant code in saver.asp, upload.asp or whatever files you have...show along with response.write statments...

-DNG
 
I went back to the drawing board and simplified things. I wanted to be sure I could pass a basic form variable on the server. I found that I couldn't pass a form variable at all. I don't understand it. I called the Hosting company and they said everything was fine on their side.

I am able to run ASP code because I can see the variable in the view source.
Have you run into this before? Here is my test code below. Again, it's not part of my previous script, it's just for testing.


Page 1 (test1.asp)
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="test2.asp">
<input name="pass" type="Hidden" value="1234">
<input name="pass2" type="text" value="">
<INPUT TYPE="SUBMIT" VALUE="Go!">
</FORM>

Page 2 (test2.asp)
<% response.write request.form("pass")
response.write request.form("pass2")
response.write("ASP Works")%>

As far as tesing goes. It's just to see if the inputs work. I used one hidden and one test. I just entered something in the test box and still nothing from either. I did a reponse.write below with static text so that I could be sure the form processed.

Any suggestions as to where to go from here are most eagerly welcomed. I have never run into this before.
Thanks...


 
That enctype will stop the request collections from working correctly. You should only be using that enctype in confunction with a component, which will provide an alternative means of accessing the data.

Try using this and test...

<FORM METHOD="POST" ACTION="test2.asp">

and if it works...then you need to read the manuals for your mail program to see how to use the enc type...

-DNG

 
Yes, I have been doing the same thing recently with file uploads.
I believe that the type=file is actually causing the return to be an object. When I tried accessing it from one page it worked but failed when passed to another.

Cirrus9, take a look at this link. The author is using that enctype along with type=file to do binary uploads to either a server or a database (depending on which script you use) and I believe it is supposed to handle up to 2Gig.
The code breaks the binary file into chunks as it is processed.


Note though that once the load.initialize method is used you will not be able to use Request.Form to get values and will have to use load.getValue(inputTagName).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top