473,568 Members | 2,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File uploading mixed with form input

I've been browsing around the web for an answer to this and I can't
find a good answer to it.... here's the problem:

I am using an ASP include file called "ClsUpload. asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all. I
first tried using the normal "Request("Listi d")" function, but that
didn't work (At first I was using it after the file upload and it gave
me an error message. Then I moved it to before the upload and it
doesn't give me an error anymore, but also doesn't seem to see
anything).

Then I tried request.form("l istid"), which some of the discussions on
the web point to. The code still sees nothing at all being submitted. I
tried it both before and after the file upload....

I don't see any info on doing something like this within the
clsupload.asp file, so I'm thinking that the problem is stemming from
my use of the enctype="multip art/form-data" tag.

How can I do this? I suppose that if worst comes to worst, i can just
break the form up accross two pages and use it like that, but that
seems kind of ugly. Is there a simple way around this?

Jul 11 '06 #1
5 5249
On Tue, 11 Jul 2006 09:03:48 -0500, furby <Wo*******@gmai l.comwrote:
I am using an ASP include file called "ClsUpload. asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all.
These classes (and also their COM counterparts) work by manually
processing the form data submitted by the browser, which renders the
Request.Form collection inoperable. Normally they expose their own Form
collection so that this data is still available. If your upload utility
doesn't have such functionality, you might consider using the one from
http://www.freeaspupload.net/ instead.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 11 '06 #2
"furby" <Wo*******@gmai l.comwrote:
>I've been browsing around the web for an answer to this and I can't
find a good answer to it.... here's the problem:

I am using an ASP include file called "ClsUpload. asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all. I
first tried using the normal "Request("Listi d")" function, but that
didn't work (At first I was using it after the file upload and it gave
me an error message. Then I moved it to before the upload and it
doesn't give me an error anymore, but also doesn't seem to see
anything).

Then I tried request.form("l istid"), which some of the discussions on
the web point to. The code still sees nothing at all being submitted. I
tried it both before and after the file upload....

I don't see any info on doing something like this within the
clsupload.as p file, so I'm thinking that the problem is stemming from
my use of the enctype="multip art/form-data" tag.
Basically, yes. The 'enctype="multi part/form-data"' tag causes the
contents of the form - including any files specified by <input
type="file".... tags as well as more normal tags - to be transmitted
in MIME format. All the data is there, and if the component you're
using to untangle the MIME blob isn't giving you the contents of the
"normal" tags, then it's not doing its job. I'm sure you can find
something that will work properly.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls. gov
Jul 11 '06 #3
Freeaspupload.a sp works like a charm - thanks. Now, for the next
question and it relates directly to that particular class.

How do I retrieve the name of the uploaded file? I see a second class
named "UploadedFi le" but there is no documentation for it. The
documentation refers to the filename property of the main object, but
that doesn't work...

Justin Piper wrote:
On Tue, 11 Jul 2006 09:03:48 -0500, furby <Wo*******@gmai l.comwrote:
I am using an ASP include file called "ClsUpload. asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all.

These classes (and also their COM counterparts) work by manually
processing the form data submitted by the browser, which renders the
Request.Form collection inoperable. Normally they expose their own Form
collection so that this data is still available. If your upload utility
doesn't have such functionality, you might consider using the one from
http://www.freeaspupload.net/ instead.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 11 '06 #4
On Tue, 11 Jul 2006 15:14:16 -0500, furby <Wo*******@gmai l.comwrote:
Freeaspupload.a sp works like a charm - thanks. Now, for the next
question and it relates directly to that particular class.

How do I retrieve the name of the uploaded file? I see a second class
named "UploadedFi le" but there is no documentation for it. The
documentation refers to the filename property of the main object, but
that doesn't work...
There's an UploadedFiles property that exposes a Scripting.Dicti onary
object with information about all the files uploaded. Something like
this should do the trick:

Dim upload, file
Set upload = New FreeASPUpload
For Each file In upload.Uploaded Files.Items()
Response.Write file.FileName & "<br>" ' or whatever you like
Next

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 12 '06 #5
Excellent! Thank you very much - works like a chamr!

Justin Piper wrote:
On Tue, 11 Jul 2006 15:14:16 -0500, furby <Wo*******@gmai l.comwrote:
Freeaspupload.a sp works like a charm - thanks. Now, for the next
question and it relates directly to that particular class.

How do I retrieve the name of the uploaded file? I see a second class
named "UploadedFi le" but there is no documentation for it. The
documentation refers to the filename property of the main object, but
that doesn't work...

There's an UploadedFiles property that exposes a Scripting.Dicti onary
object with information about all the files uploaded. Something like
this should do the trick:

Dim upload, file
Set upload = New FreeASPUpload
For Each file In upload.Uploaded Files.Items()
Response.Write file.FileName & "<br>" ' or whatever you like
Next

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 12 '06 #6

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

Similar topics

5
5439
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. I want to develop a webpage where people can send attachments that are stored on their local PC.
4
2182
by: M P | last post by:
Can you help me find an asp code that will upload a file from my PC to web server? Mark
4
9708
by: Shawn Mesiatowsky | last post by:
I have an html form that accepts a file for uploading, but I wanted to create a program to automate the upload procedure. I beileive you use the Webresponse class, but I was not sure how to use this class to post a file to a specified website. In some documentation I have, it also specifies the Request Header must be: Content-type:...
13
4289
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I...
7
3173
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file" name="file_1" size=46 /><input type=submit /> so, after adding a few files, the input fields look like this:
3
23051
acoder
by: acoder | last post by:
How to Upload a File in Coldfusion Use the cffile tag for uploading files to the server. Note that allowing people to upload files is fraught with danger and only trusted users should be allowed to upload files. Checks should be made to make sure that only allowed file types are uploaded. The Client-Side First of all, let us deal with...
3
1903
ganesanji
by: ganesanji | last post by:
hi all, I have written a php coding for uploading a file to a specific folder or location in server which is a Linux server. I think the coding for file uploaing is correct. But it does not work properly. That means the file is not uploaded to the specified location. It always executes the "else" condition in my coding. I think the...
1
5441
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one group get automatically re-directed after uploading. However, this member group never gets the benefit of knowing if they've uploaded an incorrect...
4
4104
rahulephp
by: rahulephp | last post by:
i think i am missing something in the below script: It shows error an do not upload files to destination: Let me know how to solve this: <?php if (isset($_POST)) { $uploadArray= array();
0
7690
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...
1
7654
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6273
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
5492
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
3649
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
3630
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1206
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
930
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.