473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cannot use Request.Form?

I try to use script from www.freeaspupload.net for upload file.
I need to store in session object the names of uploaded files but I get an
error - Cannot use Request.Form collection after calling BinaryRead
How can I make it?

Part of this script:

<form name="frmSend" method="POST" enctype="multipart/form-data"
action="upload_file.asp" onSubmit="return onSubmitForm();">
<span>File 1 :</span> <input type="file" name="file" size="35"
class="form"><br><br>
<span>File 2: </span><input type="file" name="file_2" size="35"
class="form"><br><br>
<input type="submit" value="Submit" class="form">
</form>
....
..
....
<%

function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)

' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function

SaveFiles = ""
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then

for each fileKey in Upload.UploadedFiles.keys
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & ""
next
else
SaveFiles = "no file."
end if
end function
Session("file") = SaveFiles
'#### ###

Session("file") = Trim(Request.Form("file"))
Session("file_2") = Trim(Request.Form("file_2"))

'#### ###
Thx for help
Jul 22 '05 #1
4 5882
Generally the upload compoent provides its own Form collection that you
should use instead of the usual Request.Form collection (check the
documentation for your component).
My understanding is that this is because upload components are parsing
themselves all the incoming data making then the regular collection
unavailable...

--
Patrice

"Zibi" <no****@won.com> a écrit dans le message de
news:db**********@nemesis.news.tpi.pl...
I try to use script from www.freeaspupload.net for upload file.
I need to store in session object the names of uploaded files but I get an error - Cannot use Request.Form collection after calling BinaryRead
How can I make it?

Part of this script:

<form name="frmSend" method="POST" enctype="multipart/form-data"
action="upload_file.asp" onSubmit="return onSubmitForm();">
<span>File 1 :</span> <input type="file" name="file" size="35"
class="form"><br><br>
<span>File 2: </span><input type="file" name="file_2" size="35"
class="form"><br><br>
<input type="submit" value="Submit" class="form">
</form>
...
.
...
<%

function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)

' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function

SaveFiles = ""
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then

for each fileKey in Upload.UploadedFiles.keys
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & ""
next
else
SaveFiles = "no file."
end if
end function
Session("file") = SaveFiles
'#### ###

Session("file") = Trim(Request.Form("file"))
Session("file_2") = Trim(Request.Form("file_2"))

'#### ###
Thx for help

Jul 22 '05 #2

Użytkownik "Patrice" <no****@nowhere.com> napisał w wiadomości
news:%2****************@TK2MSFTNGP15.phx.gbl...
Generally the upload compoent provides its own Form collection that you
should use instead of the usual Request.Form collection (check the
documentation for your component).
My understanding is that this is because upload components are parsing
themselves all the incoming data making then the regular collection
unavailable...


Documentation is very bearing.
There is written:
Public properties:

ContentType, FileName, Length.
No methods.

So it's not possible?


Jul 22 '05 #3
The properties you looked are for the UploadedFile file class.

According to http://www.freeaspupload.net/freeasp...umentation.asp
you do have a Form collection for the FreeASPUpload class. Try to use this
collection instead...

--
Patrice

"Zibi" <no****@won.com> a écrit dans le message de
news:db**********@nemesis.news.tpi.pl...

Użytkownik "Patrice" <no****@nowhere.com> napisał w wiadomości
news:%2****************@TK2MSFTNGP15.phx.gbl...
Generally the upload compoent provides its own Form collection that you
should use instead of the usual Request.Form collection (check the
documentation for your component).
My understanding is that this is because upload components are parsing
themselves all the incoming data making then the regular collection
unavailable...


Documentation is very bearing.
There is written:
Public properties:

ContentType, FileName, Length.
No methods.

So it's not possible?

Jul 22 '05 #4
Zibi wrote:
Użytkownik "Patrice" <no****@nowhere.com> napisał w wiadomości
news:%2****************@TK2MSFTNGP15.phx.gbl...
Generally the upload compoent provides its own Form collection that
you should use instead of the usual Request.Form collection (check
the documentation for your component).
My understanding is that this is because upload components are
parsing themselves all the incoming data making then the regular
collection unavailable...


Documentation is very bearing.
There is written:
Public properties:

ContentType, FileName, Length.
No methods.

So it's not possible?


See:

http://www.freeaspupload.net/freeasp...umentation.asp

Especially this part:
**********************************************
This page will receive the information from the form, save the uploaded
files,
and process any other fields in your form.
<snip>
To process other fields in the form, use the Form collection

of the upload object the same way you would use the Form collection of the
Request object. For example, if your form had a text element named UserName,
your processing code would include:
strUserName = Upload.Form("UserName")
**********************************************

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: nc | last post by:
My iterator can find my collection when my Action class calls my jsp directly, however when my Action class calls an html file that is set up with IFrames (one of which is loading that same jsp), I...
6
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line...
5
by: rathnesh | last post by:
when using a web application which includes taking an asp page then going to another asp page and coming back to first page ...some times connection to iis gets terminated and page canot be...
5
by: M P | last post by:
Hi Team! Hope that you could help me! Its been days since I made this script but I cannot fix the problem! IE is prompting me that there is a Syntax Error but it seems that the syntax is OK! Can...
2
by: CJM | last post by:
I'm running a stored procedure that inserts a record into a table then returns the Identity field value. I've done this kind of thing plenty of times in the past, but I'm obviously doing something...
2
by: Jack | last post by:
Hi, I got a simple form where one needs to input data. The data is being processed in an asp page. However, I cannot figure out why couple of values I am typing in the form is not being retrived...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
2
by: Griff | last post by:
Bizarre problem here.... I have a classic ASP web page that exists in one project. I have copied this code file into another web project and it errors! The code has not been altered in any...
1
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.