Hello,
We have a small program that allows licensees around the world to submit requests to our home office. They complete the request on an ASP form (with an HTM page) over a https connection. One of the required fields is for upload. Starting in the last week, the page has begun to "misbehave". I was able to recreate the problem and it looks like the form is not able to pick up the "request.form" statements. I've done a little research and it appears that it might be the tag "enctype='multipart/form-data' in conflict with the attempt to use "request.form" Two main questions, 1) what should I use instead of request.form and 2) why would it start complaining all of a sudden. Also, the error doesn't occur with every request, it is sporadic. Also, should note that we are using ASPSmartUpload and 2 months ago I needed to edit the IIS settings to increase file size - but I'm sure this is adifferent issue.
Any suggestions would be extremely helpful!
Julie
5 1751
Hmmm,
I had a similar problem a few months back. We had a registration form (didn't include an upload field) that clients could fill out to register for our product. For some reason, about 50-60% of the time.. the form submissions would generate random invalid characters even though we were preventing them and cleaning them out using client side javascript and asp - all the potential clients we spoke to regarding the problem denied entering these themselves - so the information in the request.form object got altered somehow. You'd have the first name field be entered as "Joe" and returned in the request.form object as j%%%o%20%20%20.
We never did figure it out, though that is an excellent point about the enctype - I'll take a look at it again (it's still somewhere on our server) and check to see if it uses an enctype - i'll get back to you.
Hi Julie,
1) instead of 'request.form("myTextInput")' you can just say 'request("myTextInput")'. The ".form" is just supposed to specify which part of the request object had the input, and it isn't really necessary unless you think you have a cookie, a querystring, or a serverVariable with the same name. A good way to test what info any page receives is this: - response.write "Form inputs:<br>" & vbNewLine
-
for each x in request.form
-
response.write x & request.form(x) & "<br>" & vbNewLine
-
next
-
-
response.write "Querystring inputs:<br>" & vbNewLine
-
for each x in request.querystring
-
response.write x & request.querystring(x) & "<br>" & vbNewLine
-
next
-
-
response.write "Cookies:<br>" & vbNewLine
-
for each x in request.cookies
-
response.write x & request.cookies(x) & "<br>" & vbNewLine
-
next
-
-
response.write "Server variables:<br>" & vbNewLine
-
for each x in request.serverVariables
-
response.write x & request.serverVariables(x) & "<br>" & vbNewLine
-
next
This will print all the info sent to the page (except that file inputs will only show the file name if printed like this)
2- I don'[t know why this would all of a sudden cause an error. You definitely need the enctype as you stated above in order to send both files and text inputs. Is the data sent to ASPSmartUpload first, and then sent on again to another ASP page on your server?
Jared
Hi Julie,
1) instead of 'request.form("myTextInput")' you can just say 'request("myTextInput")'. The ".form" is just supposed to specify which part of the request object had the input, and it isn't really necessary unless you think you have a cookie, a querystring, or a serverVariable with the same name. A good way to test what info any page receives is this: - response.write "Form inputs:<br>" & vbNewLine
-
for each x in request.form
-
response.write x & request.form(x) & "<br>" & vbNewLine
-
next
-
-
response.write "Querystring inputs:<br>" & vbNewLine
-
for each x in request.querystring
-
response.write x & request.querystring(x) & "<br>" & vbNewLine
-
next
-
-
response.write "Cookies:<br>" & vbNewLine
-
for each x in request.cookies
-
response.write x & request.cookies(x) & "<br>" & vbNewLine
-
next
-
-
response.write "Server variables:<br>" & vbNewLine
-
for each x in request.serverVariables
-
response.write x & request.serverVariables(x) & "<br>" & vbNewLine
-
next
This will print all the info sent to the page (except that file inputs will only show the file name if printed like this)
2- I don'[t know why this would all of a sudden cause an error. You definitely need the enctype as you stated above in order to send both files and text inputs. Is the data sent to ASPSmartUpload first, and then sent on again to another ASP page on your server?
Jared
Hi Jared,
Thanks for your reply. Without a doubt, issues that happen "intermittently" are the most frustrating to troubleshoot!
I changed Request.form to just request, but got the same results. I added your code and as expected all the .form elements are blank.
The page takes a number of the form elements and posts them to a database via a stored procedure, then the upload occurs
Thanks,
Julie
Hi Jared,
Thanks for your reply. Without a doubt, issues that happen "intermittently" are the most frustrating to troubleshoot!
I changed Request.form to just request, but got the same results. I added your code and as expected all the .form elements are blank.
The page takes a number of the form elements and posts them to a database via a stored procedure, then the upload occurs
Thanks,
Julie
When you say blank, do you mean nothing is there like this: - Form Inputs:
-
myTextInput:
-
myfileInput:
-
mySelect:
-
submit:
-
Querystring inputs:
or like this: - Form Inputs:
-
Querystring inputs:
?
I think the problem is that you are going from one page to another on some conditions, perhaps depending on the size of the file (there is a limit to the size of files that can be imported through HTML forms regardless of server settings. If the file is larger, good uploaders can circumvent this restriction, and their methods are pretty complicated. It is my guess that ASPSmartUpload is sending data to multiple scripts) and somehow the form data isn't making it all the way through.
If the form data is first accessed somewhere else, then I would do this:
-The first time you access the data (right before you store it in the db), save all of the form data as session-level variables (this won't work for the file, unfortunately) like this: - for each x in request.form
-
session(x) = request.form(x)
-
next
-then when you need it later, ask for session("whatever") instead of request("whatever"), its session name will be the same as its request name. Let me know if that works.
Jared
When you say blank, do you mean nothing is there like this: - Form Inputs:
-
myTextInput:
-
myfileInput:
-
mySelect:
-
submit:
-
Querystring inputs:
or like this: - Form Inputs:
-
Querystring inputs:
?
I think the problem is that you are going from one page to another on some conditions, perhaps depending on the size of the file (there is a limit to the size of files that can be imported through HTML forms regardless of server settings. If the file is larger, good uploaders can circumvent this restriction, and their methods are pretty complicated. It is my guess that ASPSmartUpload is sending data to multiple scripts) and somehow the form data isn't making it all the way through.
If the form data is first accessed somewhere else, then I would do this:
-The first time you access the data (right before you store it in the db), save all of the form data as session-level variables (this won't work for the file, unfortunately) like this: - for each x in request.form
-
session(x) = request.form(x)
-
next
-then when you need it later, ask for session("whatever") instead of request("whatever"), its session name will be the same as its request name. Let me know if that works.
Jared
Jared,
Thanks again for your help. After a lot of research, we discovered that at some point in the past, somebody started the work to move to another upload product. For some reason the half-written code that has been there for awhile started to interefere with the page's processing. I ended up commenting out the offensive code and we are back in business.
I truly apprecuate the time you took to help me out!
Happy Monday!
Julie
Sign in to post your reply or Sign up for a free account.
Similar topics
by: sentinel |
last post by:
Hi,
Wonder if anyone can help with this problem:
I am using an app with several pages, using a session to track vars
between the pages, and using an image map to re-direct back and
forwards...
|
by: Philip D Heady |
last post by:
I have a webpage that uploads a photo picture file to server, but goes
through some error checking before it redirects to the next page. Since I do
not have PHP compiled with mime type support I...
|
by: Sean Dotson |
last post by:
I have a form that passes variables to an asp file and then uploads a file.
For some reason the request.form is not getting the info from the form.
It's returning blanks. Any insight would be...
|
by: Du |
last post by:
I'm trying to automate the upload process to yousendit.com, but the file
size doesn't add up and yousendit.com keep rejecting my upload (it accepts
the upload until the very end)
I don't know...
|
by: Alex Sibilev |
last post by:
Hello,
I have a really weird problem I've been trying to solve it without any luck
for the last couple of hours :(
I'm writing a "conference board" application (quite similar to ASP.NET...
|
by: Emmanuel Petit |
last post by:
First of all I am rather new into PHP. I use php 5 and I am putting
together a web site for a local association I belong too.
Most of the site is okay, except for this problem :
I need to be...
|
by: chunk1978 |
last post by:
hi there... i have a form where a user may optionally upload a maximum of 2 files along with other textual data (there are 2 file fields built in the form). i'm having trouble writing a php script...
|
by: badvoc |
last post by:
Hi to all,
Firstly I must state my knowledge of php is limited but I am a quick learner. I have taken on the task of finishing a friends website due to his untimely passing and have hit a problem...
|
by: jeremy.gehring |
last post by:
Hey all,
OK I'm not much of a PHP programmer; but needs must as they say. I
have written AJAX file upload system that uses a PERL CGI script so
that a PHP script can get the progress (nifty...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
| |