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

WebRequest Filename

P: n/a
I am trying to create a downloader which will bypass the saveas box in the
WebBrowser control. I have the file downloading, but I don't know what the
filename is that is being passed through the stream. Is their a way to
determine what the file name is so that I can execute the appropriate
functionality of the extensions. The stream is created dynamically so I
cannot capture the filename straight from the URL.
Thanks
STeve

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Jul 21 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Steve,

Can you explain this more, because this sounds like plain hacking.

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44***********************@news.newsdemon.com. ..
>I am trying to create a downloader which will bypass the saveas box in the
WebBrowser control. I have the file downloading, but I don't know what the
filename is that is being passed through the stream. Is their a way to
determine what the file name is so that I can execute the appropriate
functionality of the extensions. The stream is created dynamically so I
cannot capture the filename straight from the URL.
Thanks
STeve
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

Jul 22 '06 #2

P: n/a
Thus wrote Steve,
I am trying to create a downloader which will bypass the saveas box in
the WebBrowser control. I have the file downloading, but I don't know
what the filename is that is being passed through the stream. Is
their a way to determine what the file name is so that I can execute
the appropriate functionality of the extensions. The stream is
created dynamically so I cannot capture the filename straight from the
URL.
I don't really understand what you're trying to achieve.

Either you know the file name already, because it's part of the URL, like
http://host/path/to/file.foo --file.foo is your file name. Actually, the
real file name might be completely different on the server side, but you'll
never find out, depending on what actually happens on the server side.

Or you're accessing a resource without any file component in the path, like
http://host/path/to -- if the server redirects that request internally, you
also never know what the file name on the server side was. If the server
redirects you externally, the former case applies.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jul 22 '06 #3

P: n/a
The website is runing a JSP which determines which file to send. In order
to download a file using the WebBrowser, we have caught the link to the JSP
and cancelled the navagating (thought the Navagating event of the
webBrowser). We then download the file using the client application. The
problem is that I do not know the filename as it is sent down via a stream
without the filename attached (or at least I don't know how to determine the
filename). If you executed the link in IE or Firefox normally, the saveas
dialog will popup with the filename. I want to know how I can determine the
filename using the WebRequest etc. so that I know what file is being sent
and how to execute the file. ie. Zip, xml, doc, etc.

Most samples I have looked at have the filename linked to the URL and they
just parse out the filename. My URL is a simple JSP and therefore I can't
tell what the filename is.

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Steve,

Can you explain this more, because this sounds like plain hacking.

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44***********************@news.newsdemon.com. ..
>>I am trying to create a downloader which will bypass the saveas box in the
WebBrowser control. I have the file downloading, but I don't know what
the filename is that is being passed through the stream. Is their a way
to determine what the file name is so that I can execute the appropriate
functionality of the extensions. The stream is created dynamically so I
cannot capture the filename straight from the URL.
Thanks
STeve
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access



--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem
Jul 22 '06 #4

P: n/a
Steve,

That they have protect it with JSP means that they won't allow you to use
the real dataname, in other words, trying to get a file direct means in most
countries hacking.

Just my idea,

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44**********************@news.newsdemon.com.. .
The website is runing a JSP which determines which file to send. In
order to download a file using the WebBrowser, we have caught the link to
the JSP and cancelled the navagating (thought the Navagating event of the
webBrowser). We then download the file using the client application. The
problem is that I do not know the filename as it is sent down via a stream
without the filename attached (or at least I don't know how to determine
the filename). If you executed the link in IE or Firefox normally, the
saveas dialog will popup with the filename. I want to know how I can
determine the filename using the WebRequest etc. so that I know what file
is being sent and how to execute the file. ie. Zip, xml, doc, etc.

Most samples I have looked at have the filename linked to the URL and they
just parse out the filename. My URL is a simple JSP and therefore I can't
tell what the filename is.

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>Steve,

Can you explain this more, because this sounds like plain hacking.

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44***********************@news.newsdemon.com ...
>>>I am trying to create a downloader which will bypass the saveas box in
the WebBrowser control. I have the file downloading, but I don't know
what the filename is that is being passed through the stream. Is their a
way to determine what the file name is so that I can execute the
appropriate functionality of the extensions. The stream is created
dynamically so I cannot capture the filename straight from the URL.
Thanks
STeve
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access


--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem

Jul 22 '06 #5

P: n/a
So why is it that if I save it using IE or Firefox, it brings up the name of
the file?

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Steve,

That they have protect it with JSP means that they won't allow you to use
the real dataname, in other words, trying to get a file direct means in
most countries hacking.

Just my idea,

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44**********************@news.newsdemon.com.. .
>The website is runing a JSP which determines which file to send. In
order to download a file using the WebBrowser, we have caught the link to
the JSP and cancelled the navagating (thought the Navagating event of the
webBrowser). We then download the file using the client application.
The problem is that I do not know the filename as it is sent down via a
stream without the filename attached (or at least I don't know how to
determine the filename). If you executed the link in IE or Firefox
normally, the saveas dialog will popup with the filename. I want to know
how I can determine the filename using the WebRequest etc. so that I know
what file is being sent and how to execute the file. ie. Zip, xml, doc,
etc.

Most samples I have looked at have the filename linked to the URL and
they just parse out the filename. My URL is a simple JSP and therefore I
can't tell what the filename is.

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
>>Steve,

Can you explain this more, because this sounds like plain hacking.

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44***********************@news.newsdemon.co m...
I am trying to create a downloader which will bypass the saveas box in
the WebBrowser control. I have the file downloading, but I don't know
what the filename is that is being passed through the stream. Is their
a way to determine what the file name is so that I can execute the
appropriate functionality of the extensions. The stream is created
dynamically so I cannot capture the filename straight from the URL.
Thanks
STeve
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access


--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem



--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Jul 23 '06 #6

P: n/a
Steve
What you want to do is in my idea at the edge, not real dotNet and certainly
not something for a newsgroup like this.

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44***********************@news.newsdemon.com. ..
So why is it that if I save it using IE or Firefox, it brings up the name
of the file?

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>Steve,

That they have protect it with JSP means that they won't allow you to use
the real dataname, in other words, trying to get a file direct means in
most countries hacking.

Just my idea,

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44**********************@news.newsdemon.com. ..
>>The website is runing a JSP which determines which file to send. In
order to download a file using the WebBrowser, we have caught the link
to the JSP and cancelled the navagating (thought the Navagating event of
the webBrowser). We then download the file using the client
application. The problem is that I do not know the filename as it is
sent down via a stream without the filename attached (or at least I
don't know how to determine the filename). If you executed the link in
IE or Firefox normally, the saveas dialog will popup with the filename.
I want to know how I can determine the filename using the WebRequest
etc. so that I know what file is being sent and how to execute the file.
ie. Zip, xml, doc, etc.

Most samples I have looked at have the filename linked to the URL and
they just parse out the filename. My URL is a simple JSP and therefore
I can't tell what the filename is.

Steve
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Steve,

Can you explain this more, because this sounds like plain hacking.

Cor

"Steve" <sm***@Spam.Be.Gone.Hotmail.comschreef in bericht
news:44***********************@news.newsdemon.c om...
>I am trying to create a downloader which will bypass the saveas box in
>the WebBrowser control. I have the file downloading, but I don't know
>what the filename is that is being passed through the stream. Is their
>a way to determine what the file name is so that I can execute the
>appropriate functionality of the extensions. The stream is created
>dynamically so I cannot capture the filename straight from the URL.
>
>
Thanks
STeve
>
>
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem


--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

Jul 23 '06 #7

P: n/a
Steve <sm***@Spam.Be.Gone.Hotmail.comwrote:
I am trying to create a downloader which will bypass the saveas box in the
WebBrowser control. I have the file downloading, but I don't know what the
filename is that is being passed through the stream. Is their a way to
determine what the file name is so that I can execute the appropriate
functionality of the extensions. The stream is created dynamically so I
cannot capture the filename straight from the URL.
Have a look at the Content-Disposition header. It should be something
like:

attachment; filename=myfilename.dat

Parse that to get the filename, then save the file appropriately.

(I'm not sure why Cor would think this is hacking - it's not
"protected" by a JSP at all, just served by one, by the sounds of it.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jul 23 '06 #8

P: n/a
Jon,

We protect on our website our emailadresses by javascript. We do that not
for nothing. I am certainly able myself to get those if somebody else does
that. I am not known with JSP, but if it would be on a ASP page where
original pictures where placed in a database or in a special protected
directory, than the retrieval of that would be seen by me as a kind of
hacking.

As I wrote for me is this going on the edge. You probably can say as long as
the folder is not protected on internet it is free, I am in doubt if that
theorie from the begin of internet will be seen at the moment like that by
any judge in any country.

But just my thought about it.

Cor

"Jon Skeet [C# MVP]" <sk***@pobox.comschreef in bericht
news:MP************************@msnews.microsoft.c om...
Steve <sm***@Spam.Be.Gone.Hotmail.comwrote:
>I am trying to create a downloader which will bypass the saveas box in
the
WebBrowser control. I have the file downloading, but I don't know what
the
filename is that is being passed through the stream. Is their a way to
determine what the file name is so that I can execute the appropriate
functionality of the extensions. The stream is created dynamically so I
cannot capture the filename straight from the URL.

Have a look at the Content-Disposition header. It should be something
like:

attachment; filename=myfilename.dat

Parse that to get the filename, then save the file appropriately.

(I'm not sure why Cor would think this is hacking - it's not
"protected" by a JSP at all, just served by one, by the sounds of it.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Jul 23 '06 #9

P: n/a
Cor Ligthert [MVP] <no************@planet.nlwrote:
We protect on our website our emailadresses by javascript.
That's obfuscating the HTML - there's no obfuscation going on here. The
Content-Disposition header is a perfectly normal one, there's no extra
trick involved. It's just a case of using that as part of WebRequest.
We do that not
for nothing. I am certainly able myself to get those if somebody else does
that. I am not known with JSP, but if it would be on a ASP page where
original pictures where placed in a database or in a special protected
directory, than the retrieval of that would be seen by me as a kind of
hacking.
In this case the OP can download the file and be presented with the
filename when he's downloaded it. How is automating that "hacking"?
As I wrote for me is this going on the edge. You probably can say as long as
the folder is not protected on internet it is free, I am in doubt if that
theorie from the begin of internet will be seen at the moment like that by
any judge in any country.
All the OP wants to do is emulate the browser's reaction to the
Content-Disposition header. The filename isn't being "protected" by the
JSP - it's coming down as a header in the normal way! It's just easier
(presumably) for the site to serve the pages with a JSP than to make
the filename available as part of the URL. That's often the case when a
file is served from a database or something similar.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jul 23 '06 #10

P: n/a
Thanks Jon,

This is exactly what I have been looking for. I guess I just didn't know
what header to search through.

Thanks again
Steve

This is exactly what I was looking for. I looked at the headers in MSDN
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
Steve <sm***@Spam.Be.Gone.Hotmail.comwrote:
>I am trying to create a downloader which will bypass the saveas box in
the
WebBrowser control. I have the file downloading, but I don't know what
the
filename is that is being passed through the stream. Is their a way to
determine what the file name is so that I can execute the appropriate
functionality of the extensions. The stream is created dynamically so I
cannot capture the filename straight from the URL.

Have a look at the Content-Disposition header. It should be something
like:

attachment; filename=myfilename.dat

Parse that to get the filename, then save the file appropriately.

(I'm not sure why Cor would think this is hacking - it's not
"protected" by a JSP at all, just served by one, by the sounds of it.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Jul 24 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.