How to send the uploaded file's name???

R

riteshjain82

Hi, Please go through this:

I am having a file (default.asp) on which i am taking many details from
a user before mailing it to someone. I have also provided the user with
a facility of uploading files on a server. I am uploading files from a
page upload.asp which has a link on default.asp. Now my problem is
that, how can i send the file name that is uploaded, in a mail along
with other details that the user enters on default.asp?? In the asp in
which i am sending the email, i am collecting all the details from
default.asp.
Please help....
 
R

Ray Costanzo [MVP]

What upload object are you using to handle the uploads? It depends on that.
Check the documentation for the component.

Dundas upload example:

oUpload.GetFileName(oFile.OriginalPath)

Ray at work
 
M

McKirahan

Hi, Please go through this:

I am having a file (default.asp) on which i am taking many details from
a user before mailing it to someone. I have also provided the user with
a facility of uploading files on a server. I am uploading files from a
page upload.asp which has a link on default.asp. Now my problem is
that, how can i send the file name that is uploaded, in a mail along
with other details that the user enters on default.asp?? In the asp in
which i am sending the email, i am collecting all the details from
default.asp.
Please help....

Will this help? Remove the "alert()" after testing.

<html>
<head>
<title>fileup.htm</title>
<script type="text/javascript">
function upload() {
var file = document.form1.filepath.value;
if (file == "") return false;
var what = file.substr(file.lastIndexOf("\\")+1);
document.form1.filename.value = what;
alert(what); // for testing
return true;
}
</script>
</head>
<body>
<form action="" method="post" name="form1" onsubmit="return upload()">
<input type="file" name="filepath">
<input type="hidden" name="filename">
<input type="submit" value="Upload">
</form>
</body>
</html>
 
R

riteshjain82

This code is working fine but the problem is yet to be solved.

See, i have one page as A.asp which has a form for a user to enter the
data. On the A.asp itself, there is a link for upload.asp which lets
the user browse to the files that they want to upload. When the user
has browsed the file, and he clicks the upload button, the
upload_response.asp is called and it uploads the file to the server
using AspUpload component. I have set the overWriteFiles property to be
false. After uploading the file, the user clicks on the 'Done' button
to close the upload window. Then he has to fill some other data on
A.asp. When he is fininshed, he clicks on the 'Submit' button to submit
his form. At this moment, A_response.asp is called which sends the data
which the user has filled in an Email. Now the problem is, I want to
send the uploaded document as an attachment in the Email. I am using
CDO to send the Email. I am able to send all the details which the user
has filled in the form, but i am unable to get the file name for the
file which the user has uploaded.

Please help me.... its urgent.
 
M

McKirahan

This code is working fine but the problem is yet to be solved.

See, i have one page as A.asp which has a form for a user to enter the
data. On the A.asp itself, there is a link for upload.asp which lets
the user browse to the files that they want to upload. When the user
has browsed the file, and he clicks the upload button, the
upload_response.asp is called and it uploads the file to the server
using AspUpload component. I have set the overWriteFiles property to be
false. After uploading the file, the user clicks on the 'Done' button
to close the upload window. Then he has to fill some other data on
A.asp. When he is fininshed, he clicks on the 'Submit' button to submit
his form. At this moment, A_response.asp is called which sends the data
which the user has filled in an Email. Now the problem is, I want to
send the uploaded document as an attachment in the Email. I am using
CDO to send the Email. I am able to send all the details which the user
has filled in the form, but i am unable to get the file name for the
file which the user has uploaded.

Please help me.... its urgent.

Are four pages really necessary?
A.asp
upload.asp
upload_response.asp
A_response.asp

Or is it five as your first post mentioned
default.asp

First, can you identify the filename of the file to be uploaded
by my technique (or any other)?

Second, if you can then what's the problem --
passing it back to a calling page?

Why not merge all of the pages into one?

You may want to start a new thread and include the following:
a) all the details of your issue
b) stripped down source code that replicates the problem


A reread of your latest post found this:
"Now the problem is, I want to send the
uploaded document as an attachment in the Email"

Does this mean that your original problem is solved
and you have a new problem? It isn't clear.

Is it that the user selects a file to upload
(from their computer to your Web server)
and you want to e-mail it back to them?

If so, then the file is on your server and you should know it's name and
path.

I'm confused as to where you are and what you want.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top