473,770 Members | 1,833 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 5273
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
5468
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
2196
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
9718
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: application/octet-stream here is the web site html code: <form action=post method=post...
13
4322
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 cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
7
3190
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
23087
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 the client side. This assumes some knowledge of HTML.
3
1915
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 problem is lieing in the specifed path which is the target path for file uploading. I could not find out...
1
5458
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 file size or incorrect file extension. Members from the second group do see the "exceeds max file...
4
4116
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
9454
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8931
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4007
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
3
2849
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.