Home All Groups Group Topic Archive Search About

Passing File names between different files!!!



Author
11 Mar 2006 9:22 AM
riteshjain82
Let me explain my problem:

I have a form called which collects user data in a form in
'default.asp'. It has a link for a file 'upload.asp' where user can
browse files from his local system. When the user clicks on ATTACH
button, the file gets uploaded to the server in upload_response.asp. I
am using AspUpload component to upload files. The user then fills some
other details on the form.
After the user is finished entering details, he clicks on submit. Then
default_response.asp collects all the details from default.asp and
emails all the details to one email id. Now the problem is:

I  have the file name which gets uploaded to the server in
upload_response.asp. I want that file name to get stored in some
variable in default.asp so that i can take that variable's value in
default_response.asp, so that i can attach that file which the user has
uploaded with the email which is being sent. I am not able to get the
variable's value from upload_response.asp to default.asp

Please help.....

Author
11 Mar 2006 12:24 PM
Mike Brind
riteshjai***@gmail.com wrote:
Show quote
> Let me explain my problem:
>
> I have a form called which collects user data in a form in
> 'default.asp'. It has a link for a file 'upload.asp' where user can
> browse files from his local system. When the user clicks on ATTACH
> button, the file gets uploaded to the server in upload_response.asp. I
> am using AspUpload component to upload files. The user then fills some
> other details on the form.
> After the user is finished entering details, he clicks on submit. Then
> default_response.asp collects all the details from default.asp and
> emails all the details to one email id. Now the problem is:
>
> I  have the file name which gets uploaded to the server in
> upload_response.asp. I want that file name to get stored in some
> variable in default.asp so that i can take that variable's value in
> default_response.asp, so that i can attach that file which the user has
> uploaded with the email which is being sent. I am not able to get the
> variable's value from upload_response.asp to default.asp
>
> Please help.....

Please don't multipost.

This question was answered 5 days ago in comp.lang.javascript.

But you obviously haven't checked there to see if anyone was prepared
to go to the trouble of replying to your post.

--
Mike Brind
Author
11 Mar 2006 2:07 PM
riteshjain82
See,
My problem was not understood well there...and i thought that i posted
the question in the wrong group. thats why i posted it here. Please let
me know if you have a solution for the above problem. also, last time i
felt that i didnt explain the problem properly. This time i tried to be
clear....

Please help me....
Author
11 Mar 2006 3:08 PM
Mike Brind
riteshjai***@gmail.com wrote:

Mike Brind wrote:
Show quote
> riteshjai***@gmail.com wrote:
> > > Let me explain my problem:
> > >
> > > I have a form called which collects user data in a form in
> > > 'default.asp'. It has a link for a file 'upload.asp' where user can
> > > browse files from his local system. When the user clicks on ATTACH
> > > button, the file gets uploaded to the server in upload_response.asp. I
> > > am using AspUpload component to upload files. The user then fills some
> > > other details on the form.
> > > After the user is finished entering details, he clicks on submit. Then
> > > default_response.asp collects all the details from default.asp and
> > > emails all the details to one email id. Now the problem is:
> > >
> > > I  have the file name which gets uploaded to the server in
> > > upload_response.asp. I want that file name to get stored in some
> > > variable in default.asp so that i can take that variable's value in
> > > default_response.asp, so that i can attach that file which the user has
> > > uploaded with the email which is being sent. I am not able to get the
> > > variable's value from upload_response.asp to default.asp
> > >
> > > Please help.....
> >
> > Please don't multipost.
> >
> > This question was answered 5 days ago in comp.lang.javascript.
>
> > But you obviously haven't checked there to see if anyone was prepared
> > to go to the trouble of replying to your post.
> >
> > --
> > Mike Brind

> See,
> My problem was not understood well there...and i thought that i posted
> the question in the wrong group. thats why i posted it here. Please let
> me know if you have a solution for the above problem. also, last time i
> felt that i didnt explain the problem properly. This time i tried to be
> clear....
>
> Please help me....

X-posted to comp.language.javascript

I see you have checked now.

The answer that was provided is this:

Store the file name in the Session object, which is accessable by all
asp pages which the user calls up in a session.

Although comp.language.javascript is indeed the wrong group to post to,
that answer still shows a perfect understanding of your problem from
one of their contributors, because it is the correct answer.

http://www.w3schools.com/asp/asp_sessions.asp

--
Mike Brind
Author
12 Mar 2006 7:39 AM
riteshjain82
But what if the user has disabled the cookies on his system?? Then what
choice do i have??
Author
12 Mar 2006 8:20 AM
Mike Brind
riteshjai***@gmail.com wrote:
> But what if the user has disabled the cookies on his system?? Then what
> choice do i have??

What are you talking about? I haven't said anything about cookies.  The
link I gave you explains how to use the Session object to store
information.  The Session object and cookies are two completely
different things.

And please, when you reply in google groups, do not use the Reply link
at the end of the post.  It wipes out what you are replying to.  Click
the Show options link next to the poster's name and use the reply link
there.

--
Mike Brind
Author
12 Mar 2006 12:04 PM
Bob Barrows [MVP]
Mike Brind wrote:
> riteshjai***@gmail.com wrote:
>> But what if the user has disabled the cookies on his system?? Then
>> what choice do i have??
>
> What are you talking about? I haven't said anything about cookies.

Actually, Mike, sessions do depend on cookies. The session id is stored in a
cookie on the user's machine. No cookies = no sessions.



--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Author
12 Mar 2006 8:04 PM
Mike Brind
Bob Barrows [MVP] wrote:
>
> Actually, Mike, sessions do depend on cookies. The session id is stored in a
> cookie on the user's machine. No cookies = no sessions.
>

Of course they do.  What on earth was I thinking of??!?
Author
12 Mar 2006 9:36 AM
Randy Webb
riteshjai***@gmail.com said the following on 3/12/2006 2:39 AM:
> But what if the user has disabled the cookies on his system?? Then what
> choice do i have??

Probably the same choice as you have if they have javascript disabled.

How did this thread get in comp.lang.javascript though?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Author
12 Mar 2006 12:09 PM
Bob Barrows [MVP]
Removing the OT group from the crosspost.
riteshjai***@gmail.com wrote:
> But what if the user has disabled the cookies on his system?? Then
> what choice do i have??

Please quote the message to which you are replying.

Show quote
> I have a form called which collects user data in a form in
> 'default.asp'. It has a link for a file 'upload.asp' where user can
> browse files from his local system. When the user clicks on ATTACH
> button, the file gets uploaded to the server in upload_response.asp. I
> am using AspUpload component to upload files. The user then fills some
> other details on the form.
> After the user is finished entering details, he clicks on submit. Then
> default_response.asp collects all the details from default.asp and
> emails all the details to one email id. Now the problem is:
>
> I  have the file name which gets uploaded to the server in
> upload_response.asp. I want that file name to get stored in some
> variable in default.asp so that i can take that variable's value in
> default_response.asp, so that i can attach that file which the user
> has uploaded with the email which is being sent. I am not able to get
> the variable's value from upload_response.asp to default.asp

Without sessions or cookies, all that is left is
A. Application variable
B. Text file on the server
C. Database

Pick your alternative.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Author
12 Mar 2006 2:40 PM
riteshjain82
"
> Without sessions or cookies, all that is left is
> A. Application variable
> B. Text file on the server
> C. Database
>
> Pick your alternative.

"

You mentioned about the text file on the server. Can you please
elaborate on this?? How can i make use of this??

as far as i understood, you are trying to say that i should maintain
one text file on the server. Then i can write the file name on that
text file and then pick the file name from that text file to attach it
with the mail. Is this what you are trying to say??

People, I am new to this Google groups and dont know how to use it
effectively. Please dont mind if i do something wrong. Also i am a
fresher in a job, so dont know too much about all these technical
stuff. Please dont mind if sometime i posta foolish question.
Author
13 Mar 2006 8:43 AM
Baconbutty
riteshjai***@gmail.com wrote:

[snip]
> as far as i understood, you are trying to say that i should maintain
> one text file on the server. Then i can write the file name on that
> text file and then pick the file name from that text file to attach it
> with the mail. Is this what you are trying to say??
[/snip]

I believe that is precisely the suggestion.  You are effectively using
a flat text file as a temporary data store. You will need to use
something like the ActiveX  "Scripting.FileSystemObject" to create,
access, write to and save the file.  Further lines of research on this
option are:-

-  Scripting.FileSystemObject
-  Server.CreateObject("Scriping.FileSystemObject") - to create an
instance
-  Server.MapPath   - to ensure that the correct file path is given
-  Ensuring that your server directories have appropriate read/write
permissions (e.g. CHMOD for unix based systems).
-  Consider the likelihood of simultaneous access to the text file if
two separate users want to write to it at the same time.  Storing the
file name in a database may be a better solution if this is likely to
be the case.

Regards

Julian Turner
Author
13 Mar 2006 2:36 PM
riteshjain82
Show quote
> I believe that is precisely the suggestion.  You are effectively using
> a flat text file as a temporary data store. You will need to use
> something like the ActiveX  "Scripting.FileSystemObject" to create,
> access, write to and save the file.  Further lines of research on this
> option are:-
>
> -  Scripting.FileSystemObject
> -  Server.CreateObject("Scriping.FileSystemObject") - to create an
> instance
> -  Server.MapPath   - to ensure that the correct file path is given
> -  Ensuring that your server directories have appropriate read/write
> permissions (e.g. CHMOD for unix based systems).
> -  Consider the likelihood of simultaneous access to the text file if
> two separate users want to write to it at the same time.  Storing the
> file name in a database may be a better solution if this is likely to
> be the case.



Thanks very much Bob.
I was able to solve this problem using the suggestion given by you
about using the text file. And thanks a lot to all the kind persons who
took their time to answer my questions. (sometimes foolish i believe...
Show quote
:-) )

AddThis Social Bookmark Button