By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,153 Members | 1,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,153 IT Pros & Developers. It's quick & easy.

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

P: n/a
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....

Mar 6 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
<ri**********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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....

Mar 6 '06 #2

P: n/a
<ri**********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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>
Mar 6 '06 #3

P: n/a
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.

Mar 8 '06 #4

P: n/a
<ri**********@gmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
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.

Mar 8 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.