473,756 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ 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 4513
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.c om> a écrit dans le message de
news:11******** **************@ z14g2000cwz.goo glegroups.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\Wor kfiles", 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******* *******@TK2MSFT NGP12.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.c om> a écrit dans le message de
news:11******** **************@ z14g2000cwz.goo glegroups.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.goo gle.com...
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\Wor kfiles", 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******* *******@TK2MSFT NGP12.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.c om> a écrit dans le message de
news:11******** **************@ z14g2000cwz.goo glegroups.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*********@ya hoo.com> wrote in message news:<#9******* *******@tk2msft ngp13.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.goo gle.com...
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\Wor kfiles", 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******* *******@TK2MSFT NGP12.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.c om> a écrit dans le message de
news:11******** **************@ z14g2000cwz.goo glegroups.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
3659
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 server, I am trying: $_SESSION = "/uploaddir/"; // directory on server $_SESSION = "c:/_picture_file/"; // directory on computer
2
1603
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 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??
1
7959
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 save on the web server. The user then can hit a button to download the saved file to some location of their choice. Any help will be appreciated.
3
1449
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 safe reasons i cannot save the decription in the disk even if for a short time. The CryptoStream seem to work only with in and out files; do somebody know how i can do? Thank you very much. Federico.
1
2201
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 file stored on my web site, final visitor will see open/save file dialog, how to do that, or is there an example code do this work? thank you,
2
1286
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 able to download to a specific location on the client pc. I want to do this using asp.net but i dont know how to do this . Can anyone help me on that
16
3256
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 not print in the username or email amddress of the person doing the download - which I am collecting from a form on the previous page. I can get the name and email address to print out normally, just not into the email sending body. I have...
3
2720
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 and the application is a windows application. Does anyone have a solution to automatically downloading the file from a WebBrowser control. Thanks in Advance
3
6469
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 just opens a blank page, can anyone help <%@Language="VBScript"%> <%Option Explicit%> <%Response.Buffer = True%> <% On Error Resume Next Dim strPath strPath = CStr(Request.QueryString("file"))
0
10034
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.