473,566 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving a file in a specific Directory

All I am trying to specify a location for the file to be saved in.
currently I have a process that get the location of the file and then
prompts the user to save it in a directory. I am wondering if it is
possible to specify that directory on their system. Our clients would
have this directory on their system already....

here is the code that I am currently using

Response.Conten tType = "applicatio n/zip";
Response.Append Header("Content-Disposition", "attachment ;
filename=myzipf ile.zip");
Response.WriteF ile(@"C:\somedi rectoy\somefile .zip");
Response.Flush( );

Thanks in advance

Aug 18 '06 #1
3 1874
I guess another question would be is there a way totemporarily override
the default location the browser looks to save things in.?

Chicagoboy27 wrote:
All I am trying to specify a location for the file to be saved in.
currently I have a process that get the location of the file and then
prompts the user to save it in a directory. I am wondering if it is
possible to specify that directory on their system. Our clients would
have this directory on their system already....

here is the code that I am currently using

Response.Conten tType = "applicatio n/zip";
Response.Append Header("Content-Disposition", "attachment ;
filename=myzipf ile.zip");
Response.WriteF ile(@"C:\somedi rectoy\somefile .zip");
Response.Flush( );

Thanks in advance
Aug 18 '06 #2
Hi,

Chicagoboy27 wrote:
I guess another question would be is there a way totemporarily override
the default location the browser looks to save things in.?

Chicagoboy27 wrote:
>>All I am trying to specify a location for the file to be saved in.
currently I have a process that get the location of the file and then
prompts the user to save it in a directory. I am wondering if it is
possible to specify that directory on their system. Our clients would
have this directory on their system already....

here is the code that I am currently using

Response.Cont entType = "applicatio n/zip";
Response.Append Header("Content-Disposition", "attachment ;
filename=myzi pfile.zip");
Response.WriteF ile(@"C:\somedi rectoy\somefile .zip");
Response.Flush( );

Thanks in advance
No, the default location for the files is purely client-side. The server
cannot specify anything. Actually, this is better this way, or else you
could imagine using that for malicious actions (of course it still
request a user interaction, but users are so naive sometimes...)

Usually, the browser starts by displaying a default location, and later
displays the last location where the user saved a file. Of course it may
vary from browser to browser.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Aug 18 '06 #3
Thanks for your reply. That is what I was figuring due to security
reasons. Thanks again for taking the time to answer.
Laurent Bugnion wrote:
Hi,

Chicagoboy27 wrote:
I guess another question would be is there a way totemporarily override
the default location the browser looks to save things in.?

Chicagoboy27 wrote:
>All I am trying to specify a location for the file to be saved in.
currently I have a process that get the location of the file and then
prompts the user to save it in a directory. I am wondering if it is
possible to specify that directory on their system. Our clients would
have this directory on their system already....

here is the code that I am currently using

Response.Conte ntType = "applicatio n/zip";
Response.Append Header("Content-Disposition", "attachment ;
filename=myzip file.zip");
Response.WriteF ile(@"C:\somedi rectoy\somefile .zip");
Response.Flush( );

Thanks in advance

No, the default location for the files is purely client-side. The server
cannot specify anything. Actually, this is better this way, or else you
could imagine using that for malicious actions (of course it still
request a user interaction, but users are so naive sometimes...)

Usually, the browser starts by displaying a default location, and later
displays the last location where the user saved a file. Of course it may
vary from browser to browser.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Aug 18 '06 #4

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

Similar topics

3
12362
by: Vikram | last post by:
Hi, Given below is my task. An user can open the xls file from my website (loaded on the top frame). After filling the Excel, he can click a send button at the bottom frame. By clicking the button i have to save the file in a shared directory on the web server by a unique name. Is it possible ?
138
6446
by: theodp | last post by:
--> From http://www.techdirt.com/articles/20040406/1349225.shtml Microsoft Patents Saving The Name Of A Game Contributed by Mike on Tuesday, April 6th, 2004 @ 01:49PM from the yeah,-that's-non-obvious dept. theodp writes "As if there weren't enough dodgy patents, here's an excerpt from one granted to Microsoft Tuesday for a 'Method and...
6
1766
by: Greg Collins [MVP] | last post by:
For background, please refer to my original thread: http://groups.google.com/groups?selm=efe5w7tYEHA.3112%40tk2msftngp13.phx.gbl I've thought of a potential way around the issue, but I'm new to ASP.NET and C# and need the expertese of individuals with more experience in these languages than I have. I may be completely off target as I thought...
2
2465
by: Carpe Diem | last post by:
Hello all. My host is experiencing some troubles and I think you'll answer me before they can. After I uploaded a slightly changed JScript.NET .aspx page (the contents are not important, could be just Response.End(); or anything) the page won't load but instead shows this: Server Error in '/' Application. Compilation Error
1
1019
by: darrel | last post by:
I have a function that uploads a file to a specific directory, making the directory if it doesn't already exist. This works, unless I try to upload a file to a pre-existing directory. If I do that, I get this vague error: Exception has been thrown by the target of an invocation. From what I can tell, this is maybe a permissions issue?
1
6522
by: JohnJohnUSA | last post by:
I am using Python IDLE 2.4.3 on Windows XP. I use File->New Window to create a new program. In the Save As dialog, it always takes me to the python program directory (where python is installed). Since this is not where I want to save my source file, I have to select the directory I want. Is there a way that I can have python always bring up...
7
1954
by: Dave Kelly | last post by:
There has to be a name for what I want to do and I don't know what words to google for. I have a form here: http://www.texasflyfishers.org/firstpage.htm I want to submit it to the server and have it saved: 1. In a directory by the guides name which would be the variable 'describe11'. Create this directory if it does not already exist....
3
5789
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 and C#. I'm working in an application that automatically saves a file to a specific directory. I've seen other applications that can detect if a file of the same name already exists, and if so, adds a number to the filename. For example, if foo.doc already exists, the application is smart enough to save...
14
1417
by: Stodge | last post by:
I'm trying to do the following. I have a Python application that is run: python app1.py --location=c:\test1 What I want to do is save the location parameter, so I can then do (in the same window): python app2.py
0
7666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7644
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...
0
7951
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...
0
6260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
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 we have to send another system
0
925
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...

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.