473,583 Members | 3,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="multip art/form-data"
action="upload_ file.asp" onSubmit="retur n onSubmitForm(); ">
<span>File 1 :</span> <input type="file" name="file" size="35"
class="form"><b r><br>
<span>File 2: </span><input type="file" name="file_2" size="35"
class="form"><b r><br>
<input type="submit" value="Submit" class="form">
</form>
....
..
....
<%

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

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

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

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

Session("file") = Trim(Request.Fo rm("file"))
Session("file_2 ") = Trim(Request.Fo rm("file_2"))

'#### ###
Thx for help
Jul 22 '05 #1
4 5901
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="multip art/form-data"
action="upload_ file.asp" onSubmit="retur n onSubmitForm(); ">
<span>File 1 :</span> <input type="file" name="file" size="35"
class="form"><b r><br>
<span>File 2: </span><input type="file" name="file_2" size="35"
class="form"><b r><br>
<input type="submit" value="Submit" class="form">
</form>
...
.
...
<%

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

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

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

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

Session("file") = Trim(Request.Fo rm("file"))
Session("file_2 ") = Trim(Request.Fo rm("file_2"))

'#### ###
Thx for help

Jul 22 '05 #2

Użytkownik "Patrice" <no****@nowhere .com> napisał w wiadomo¶ci
news:%2******** ********@TK2MSF TNGP15.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******** ********@TK2MSF TNGP15.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******** ********@TK2MSF TNGP15.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("Us erName")
*************** *************** *************** *

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
10293
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 get a servlet error "cannot find collection". Not usre if my issue is HTML, JSP, WebSphere or ??? Any help is very much appreciated. HTML...
6
10323
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 120''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
5
4914
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 displayed error comes ..this error does'nt comes on a particular page .please help me to solve this problem..
5
1628
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 you help me find the problem? Note the fields PartNo and ItemDesc is the only text data type on my MS Access database.
2
22791
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 wrong this time.. I've tested the Stored Proc in QA and it works fine. The SQL code runs OK in ASP (iAffected = 1 which shows the record is...
2
1500
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 in the asp processing page. Instead it shows as a null value. Any help is appreciated. I have attached the major code for the form, the...
8
5460
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
2
8960
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 way, so I'm not sure why its errored. In more details: The page starts by validating the user, so reads from the request object,
1
2456
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 http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Order Record</title> <meta name="Microsoft Border" content="tlb, default">...
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7821
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6577
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5697
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3814
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1424
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1152
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.