473,473 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

download a file in a background without Save As

Hello,

I have a requirement wherein, a user clicks on a file name in an
ASP.NET web application, and the file should automatically be
downloaded (Without showing the "Open", "Save As") in the local machine
at a pre defined path (path defined in the registry), and launch the
file in its associated application.

I think this can be done through ActiveX Controls, but i dont know how
to create ActiveX controls in .NET??

Can anyone give me any suggestions as to how one can achieve this??

Thanks in advance for help

Cheers

Sunil

Nov 19 '05 #1
4 4491
It will require some client side setup as this is not possible by default
due to security.

You could create an ActiveX control, a.NET control or a Java applet. It's no
use IMO to create an ActiveX control in .NET. As you'll require anyway .NET
client side just create a .NET control (.NET allows to expose a .NET control
as an ActiveX control but doesn't allow to create a "plain old" ActiveX
control).

See for example : http://windowsforms.net/articles/iesourcing.aspx

Before starting you may want to quickly check the impact it will have to see
if it's worth (I would let the user choose between opening and saving)...

Patrice

--

<su******@msn.com> a écrit dans le message de
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello,

I have a requirement wherein, a user clicks on a file name in an
ASP.NET web application, and the file should automatically be
downloaded (Without showing the "Open", "Save As") in the local machine
at a pre defined path (path defined in the registry), and launch the
file in its associated application.

I think this can be done through ActiveX Controls, but i dont know how
to create ActiveX controls in .NET??

Can anyone give me any suggestions as to how one can achieve this??

Thanks in advance for help

Cheers

Sunil

Nov 19 '05 #2
Neo
Heyy Patrice,

Thanks for your suggestions. I will go through the link you have sent
me. Well there are 2 things here -
1) I want the file which the user clicks on, to be saved in the local
machine file store, as i have my own desktop application accessing it.
(The file extension is mapped to my application by default, so no
problems as File open will launch my desktop application)
So the problem is that if i show the traditional "Open" & "Save As", i
have no gurantee that the user will store in the local file store.
Secondly it will be stupid to show the user "Save the file in
C:\Program Files\MyApp\Workfiles", as this will not gurantee that the
user will do that, 99% of them will store on the desktop :)
2) The reason i came to a conclusion of a Activex is for the fact that
-
a) Activex Control is in the local machine and hence has access to the
local machine registry or the local machine file path
b) Since i am making the desktop application as well, i can package
the Activex Control, this will ensure that the control is signed and
in place in the target machine.
c) I have seen a similar kind of thing in another site, which uses
<object> tag, which i think is an ActiveX control.

Can you suggest in this scenario??

Thanks for your help

Cheers

Sunil

"Patrice" <no****@nowhere.com> wrote in message news:<uj**************@TK2MSFTNGP12.phx.gbl>...
It will require some client side setup as this is not possible by default
due to security.

You could create an ActiveX control, a.NET control or a Java applet. It's no
use IMO to create an ActiveX control in .NET. As you'll require anyway .NET
client side just create a .NET control (.NET allows to expose a .NET control
as an ActiveX control but doesn't allow to create a "plain old" ActiveX
control).

See for example : http://windowsforms.net/articles/iesourcing.aspx

Before starting you may want to quickly check the impact it will have to see
if it's worth (I would let the user choose between opening and saving)...

Patrice

--

<su******@msn.com> a écrit dans le message de
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello,

I have a requirement wherein, a user clicks on a file name in an
ASP.NET web application, and the file should automatically be
downloaded (Without showing the "Open", "Save As") in the local machine
at a pre defined path (path defined in the registry), and launch the
file in its associated application.

I think this can be done through ActiveX Controls, but i dont know how
to create ActiveX controls in .NET??

Can anyone give me any suggestions as to how one can achieve this??

Thanks in advance for help

Cheers

Sunil

Nov 19 '05 #3
Hi Neo,

If you have your application registered with the OS to handle this file
extension, then you should be able to setup your file as a Mime type in the
browser. Then, when the user clicks on the link, it should prompt them to
open the file with your application. Also, if you app is registered with the
OS, it doesn't matter where they save the file because as soon as they
double-click it (from any location), it should launch your application.

If setup correctly, it doesn't matter where they save it as your desktop app
should be making use of command line arguments to determine where a file is
located rather then hard-coded or assumed paths. (This would be a
best-practice senario: "Open %1" and then your app should be able to find %1
as the full path to the file from the command line.)

IMHO, ActiveX controls should have been phased out years ago. Aside from the
security issues (which are on a list longer than that of most of the Windows
OS bug lists). Also, unless you are 100% certain that your users are using
IE, then an ActiveX control is going to be worthless to people using other
browsers. (At my company, we don't have a standardized browser, anyone can
use whatever their heart desires, which makes internal development
interesting, to say the least.)

I would recommend fleshing out your desktop application to make better use
of the %1 command line vars and avoid tinkering with the browser and with
ActiveX controls.

HTH (and sorry about the rant and flame... lol)
~d
"Neo" <su******@gmail.com> wrote in message
news:23**************************@posting.google.c om...
Heyy Patrice,

Thanks for your suggestions. I will go through the link you have sent
me. Well there are 2 things here -
1) I want the file which the user clicks on, to be saved in the local
machine file store, as i have my own desktop application accessing it.
(The file extension is mapped to my application by default, so no
problems as File open will launch my desktop application)
So the problem is that if i show the traditional "Open" & "Save As", i
have no gurantee that the user will store in the local file store.
Secondly it will be stupid to show the user "Save the file in
C:\Program Files\MyApp\Workfiles", as this will not gurantee that the
user will do that, 99% of them will store on the desktop :)
2) The reason i came to a conclusion of a Activex is for the fact that
-
a) Activex Control is in the local machine and hence has access to the
local machine registry or the local machine file path
b) Since i am making the desktop application as well, i can package
the Activex Control, this will ensure that the control is signed and
in place in the target machine.
c) I have seen a similar kind of thing in another site, which uses
<object> tag, which i think is an ActiveX control.

Can you suggest in this scenario??

Thanks for your help

Cheers

Sunil

"Patrice" <no****@nowhere.com> wrote in message
news:<uj**************@TK2MSFTNGP12.phx.gbl>...
It will require some client side setup as this is not possible by default
due to security.

You could create an ActiveX control, a.NET control or a Java applet. It's
no
use IMO to create an ActiveX control in .NET. As you'll require anyway
.NET
client side just create a .NET control (.NET allows to expose a .NET
control
as an ActiveX control but doesn't allow to create a "plain old" ActiveX
control).

See for example : http://windowsforms.net/articles/iesourcing.aspx

Before starting you may want to quickly check the impact it will have to
see
if it's worth (I would let the user choose between opening and saving)...

Patrice

--

<su******@msn.com> a écrit dans le message de
news:11**********************@z14g2000cwz.googlegr oups.com...
> Hello,
>
> I have a requirement wherein, a user clicks on a file name in an
> ASP.NET web application, and the file should automatically be
> downloaded (Without showing the "Open", "Save As") in the local machine
> at a pre defined path (path defined in the registry), and launch the
> file in its associated application.
>
> I think this can be done through ActiveX Controls, but i dont know how
> to create ActiveX controls in .NET??
>
> Can anyone give me any suggestions as to how one can achieve this??
>
> Thanks in advance for help
>
> Cheers
>
> Sunil
>

Nov 19 '05 #4
Neo
Hello DotNetCoder,

Thanks for your inputs. Well if the file storage was not so
imperative, then i think we could have done just the "Open", "Save As"
thingie. Since the requirement is that the user works on the
downloaded file, generates another set of files and uploads all the
files again, i think i need to store the file locally in a predefined
path/folder. the files are generated automatically at the location
where the original file is stored.

Setting it up as a mime type in the browser, would not help much in
this case as it is essential for me to have the file at a known
location.

Cheers

Neo (a.k.a Sunil)
"DotNet Coder" <d0*********@yahoo.com> wrote in message news:<#9**************@tk2msftngp13.phx.gbl>...
Hi Neo,

If you have your application registered with the OS to handle this file
extension, then you should be able to setup your file as a Mime type in the
browser. Then, when the user clicks on the link, it should prompt them to
open the file with your application. Also, if you app is registered with the
OS, it doesn't matter where they save the file because as soon as they
double-click it (from any location), it should launch your application.

If setup correctly, it doesn't matter where they save it as your desktop app
should be making use of command line arguments to determine where a file is
located rather then hard-coded or assumed paths. (This would be a
best-practice senario: "Open %1" and then your app should be able to find %1
as the full path to the file from the command line.)

IMHO, ActiveX controls should have been phased out years ago. Aside from the
security issues (which are on a list longer than that of most of the Windows
OS bug lists). Also, unless you are 100% certain that your users are using
IE, then an ActiveX control is going to be worthless to people using other
browsers. (At my company, we don't have a standardized browser, anyone can
use whatever their heart desires, which makes internal development
interesting, to say the least.)

I would recommend fleshing out your desktop application to make better use
of the %1 command line vars and avoid tinkering with the browser and with
ActiveX controls.

HTH (and sorry about the rant and flame... lol)
~d
"Neo" <su******@gmail.com> wrote in message
news:23**************************@posting.google.c om...
Heyy Patrice,

Thanks for your suggestions. I will go through the link you have sent
me. Well there are 2 things here -
1) I want the file which the user clicks on, to be saved in the local
machine file store, as i have my own desktop application accessing it.
(The file extension is mapped to my application by default, so no
problems as File open will launch my desktop application)
So the problem is that if i show the traditional "Open" & "Save As", i
have no gurantee that the user will store in the local file store.
Secondly it will be stupid to show the user "Save the file in
C:\Program Files\MyApp\Workfiles", as this will not gurantee that the
user will do that, 99% of them will store on the desktop :)
2) The reason i came to a conclusion of a Activex is for the fact that
-
a) Activex Control is in the local machine and hence has access to the
local machine registry or the local machine file path
b) Since i am making the desktop application as well, i can package
the Activex Control, this will ensure that the control is signed and
in place in the target machine.
c) I have seen a similar kind of thing in another site, which uses
<object> tag, which i think is an ActiveX control.

Can you suggest in this scenario??

Thanks for your help

Cheers

Sunil

"Patrice" <no****@nowhere.com> wrote in message
news:<uj**************@TK2MSFTNGP12.phx.gbl>...
It will require some client side setup as this is not possible by default
due to security.

You could create an ActiveX control, a.NET control or a Java applet. It's
no
use IMO to create an ActiveX control in .NET. As you'll require anyway
.NET
client side just create a .NET control (.NET allows to expose a .NET
control
as an ActiveX control but doesn't allow to create a "plain old" ActiveX
control).

See for example : http://windowsforms.net/articles/iesourcing.aspx

Before starting you may want to quickly check the impact it will have to
see
if it's worth (I would let the user choose between opening and saving)...

Patrice

--

<su******@msn.com> a écrit dans le message de
news:11**********************@z14g2000cwz.googlegr oups.com...
> Hello,
>
> I have a requirement wherein, a user clicks on a file name in an
> ASP.NET web application, and the file should automatically be
> downloaded (Without showing the "Open", "Save As") in the local machine
> at a pre defined path (path defined in the registry), and launch the
> file in its associated application.
>
> I think this can be done through ActiveX Controls, but i dont know how
> to create ActiveX controls in .NET??
>
> Can anyone give me any suggestions as to how one can achieve this??
>
> Thanks in advance for help
>
> Cheers
>
> Sunil
>

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Ken | last post by:
How do I download files from the internet server to my computer? How do I tell the script the correct hard drive folder on my computer to copy the files to? After connecting to the internet...
2
by: sunilj20 | last post by:
Hello, I have a requirement wherein, a user clicks on a file name in an ASP.NET web application, and the file should automatically be downloaded (Without showing the "Open", "Save As") in the...
1
by: Andy Nguyen | last post by:
Hello all: I am in the process of creating a web page that requires me to provide download functionality. As the user enter a search string, the page will query the db and build a file that I...
3
by: Federico Bari | last post by:
I have to read and encrypted file (with DESCryptoServiceProvider class) and decrypt it without save the clear file in the disk!!! ie i'd like to have the decryption in a string variable because for...
1
by: user2008 | last post by:
Hi all, I want to track how many times visitor download file from my website, for example, when visitor click on a download link, a ASPX page will be requested, after that it will redirect to a...
2
by: savvaschr | last post by:
Hi to all I am a new in asp.net and this might seems a very simple question but i need help. I want to make a web page that will have one button and when somebody clicks on it a file will be...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
3
by: cypherkro | last post by:
Hi I have a requirement to automatically download a file using a WebBrowser control without having the "Download File" pop up windows display. I cannot use Webclient!! I am using VS2005, .net2...
3
colinod
by: colinod | last post by:
I am trying to get my site to download mp3 files without having to right click - save as on a link. I have found this code, which works as long as the file names are short, if they get a bit long it...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.