PC Review


Reply
Thread Tools Rate Thread

WebRequest Filename

 
 
Steve
Guest
Posts: n/a
 
      21st Jul 2006
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
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
Steve,

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

Cor

"Steve" <(E-Mail Removed)> schreef in bericht
news:44c13e43$0$23783$(E-Mail Removed)...
>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



 
Reply With Quote
 
Joerg Jooss
Guest
Posts: n/a
 
      22nd Jul 2006
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
news-(E-Mail Removed)


 
Reply With Quote
 
Steve
Guest
Posts: n/a
 
      22nd Jul 2006
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Steve,
>
> Can you explain this more, because this sounds like plain hacking.
>
> Cor
>
> "Steve" <(E-Mail Removed)> schreef in bericht
> news:44c13e43$0$23783$(E-Mail Removed)...
>>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
 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
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" <(E-Mail Removed)> schreef in bericht
news:44c24ce9$0$5615$(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Steve,
>>
>> Can you explain this more, because this sounds like plain hacking.
>>
>> Cor
>>
>> "Steve" <(E-Mail Removed)> schreef in bericht
>> news:44c13e43$0$23783$(E-Mail Removed)...
>>>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



 
Reply With Quote
 
Steve
Guest
Posts: n/a
 
      23rd Jul 2006
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]" <(E-Mail Removed)> wrote in message
news:%23zJC%23$(E-Mail Removed)...
> 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" <(E-Mail Removed)> schreef in bericht
> news:44c24ce9$0$5615$(E-Mail Removed)...
>> 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]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Steve,
>>>
>>> Can you explain this more, because this sounds like plain hacking.
>>>
>>> Cor
>>>
>>> "Steve" <(E-Mail Removed)> schreef in bericht
>>> news:44c13e43$0$23783$(E-Mail Removed)...
>>>>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
 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      23rd Jul 2006
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" <(E-Mail Removed)> schreef in bericht
news:44c2f8de$0$20049$(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in message
> news:%23zJC%23$(E-Mail Removed)...
>> 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" <(E-Mail Removed)> schreef in bericht
>> news:44c24ce9$0$5615$(E-Mail Removed)...
>>> 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]" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Steve,
>>>>
>>>> Can you explain this more, because this sounds like plain hacking.
>>>>
>>>> Cor
>>>>
>>>> "Steve" <(E-Mail Removed)> schreef in bericht
>>>> news:44c13e43$0$23783$(E-Mail Removed)...
>>>>>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



 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      23rd Jul 2006
Steve <(E-Mail Removed)> wrote:
> 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 - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      23rd Jul 2006
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]" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Steve <(E-Mail Removed)> wrote:
>> 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 - <(E-Mail Removed)>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too



 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      23rd Jul 2006
Cor Ligthert [MVP] <(E-Mail Removed)> wrote:
> 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 - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HttpPostedFile.saveas(filename) issue when the filename is used "-" as a part of the filename. Ken Microsoft Dot NET Framework 0 25th Feb 2009 11:58 PM
auto text: the word Filename precedes the actual filename. =?Utf-8?B?c2htdWVsZ2ltbWVs?= Microsoft Word Document Management 0 23rd Mar 2005 07:59 PM
process.start(filename), shell(filename) weird behavior Peter Proost Microsoft VB .NET 6 1st Feb 2005 01:37 AM
How to mass convert Filename.eml to Filename.msg while keeping them in original subdirectories? UncleBob Microsoft Outlook 2 17th May 2004 06:27 PM
saving file with new filename based on current filename Michael J. Malinsky Microsoft Excel Programming 5 18th Mar 2004 01:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:10 AM.