ASP pure upload - Capture FileName in form

K

Kevin Spencer

Well, after looking at the page you directed us to, I read:

Here is an example of how to access a specific file in the Files Collection
using the HTML file input element name as the Index:

<%
Response.Write "File Name:" & MyUploader.Files("file1").FileName
Response.Write "File Size:" & MyUploader.Files("file1").FileSize
Response.Write "File Type:" & MyUploader.Files("file1").ContentType
%>

It's about 1/3 of the way down the page.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
 
B

Beefminator

Hey Kevin,

Thanks for your quick response. I am still having problems, I am not
tough as making chicken tender salad.

I put the following the code in
http://www.walkhere.com/uploadexmple.asp

<%
Response.Write "File Name:" & MyUploader.Files("FILE1").FileName
Response.Write "File Size:" & MyUploader.Files("FILE1").FileSize
Response.Write "File Type:" & MyUploader.Files("FILE1").ContentType
%>

It barfed..doesn't work. What am I doing wrong?

Thanks,
Jason
 
T

Trevor L.

Beefminator said:
Hey Kevin,

Thanks for your quick response. I am still having problems, I am not
tough as making chicken tender salad.

I put the following the code in
http://www.walkhere.com/uploadexmple.asp

<%
Response.Write "File Name:" & MyUploader.Files("FILE1").FileName
Response.Write "File Size:" & MyUploader.Files("FILE1").FileSize
Response.Write "File Type:" & MyUploader.Files("FILE1").ContentType
%>

It barfed..doesn't work. What am I doing wrong?

Thanks,
Jason

Weel, as I guess you know, the error was
Thank you for your upload
File(s) not uploaded.

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'MyUploader'

/uploadexmple.asp, line 72

I am very new to ASP, but I suggest that you check the variable names.
It's posssible that Kevin was just giving an example, nor the exact code
that you need.
 
S

Stefan B Rusynko

And
Are you using the code exactly as provided or did you rename MyUploader

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Hey Kevin,
|
| Thanks for your quick response. I am still having problems, I am not
| tough as making chicken tender salad.
|
| I put the following the code in
| http://www.walkhere.com/uploadexmple.asp
|
| <%
| Response.Write "File Name:" & MyUploader.Files("FILE1").FileName
| Response.Write "File Size:" & MyUploader.Files("FILE1").FileSize
| Response.Write "File Type:" & MyUploader.Files("FILE1").ContentType
| %>
|
| It barfed..doesn't work. What am I doing wrong?
|
| Thanks,
| Jason
|
 
B

Beefminator

Yeah, the name was incorrect so I changed the name from "MyUploader" to
"Uploader"

I am now getting a different error for
http://www.walkhere.com/uploadexmple.asp:

Thank you for your upload
File(s) not uploaded.


Microsoft VBScript runtime error '800a01a8'

Object required: '[undefined]'

/uploadexmple.asp, line 73
 
K

Kevin Spencer

Well, I suggest you have a look at "line 73" of your code, as we can't see
it on the client side.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
 
B

Beefminator

Hey Kevin,

Line 73 is the following:

<% Response.Write Uploader.Files("FILE1").FileName %>
 
K

Kevin Spencer

Well, either the "Uploader" variable has not been assigned, or there is no
file in the Files collection named "FILE1".

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

It takes a tough man to make a tender chicken salad.
 
B

Beefminator

Hey Kieth,

The code: <%Response.Write Uploader.Files("file1").FileName%> is now
working.

I thought it wasn't working, but it is now. Appreciate your patience.

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top