471,594 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Copy Files

I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore

Dec 28 '06 #1
19 5775
samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Can you post your code to us?

Dec 28 '06 #2
string source = @"\\server\FileCopy\file.exe";
string dest = @"C:\Program Files\Folder\Tool\File.exe";
try
{
string newDir = @"C:\\";
Directory.SetCurrentDirectory(newDir);
dest = Directory.GetCurrentDirectory() + "Program
Files\\Folder\\Tool\\File.exe";
lblTest.Text =
System.Security.Principal.WindowsIdentity.GetCurre nt().Name.ToString();

File.Delete(dest);

File.Copy(source, dest);

lblResult.Visible = true;
}
catch (Exception f)
{
lblResult.Text = f.ToString();
lblResult.Visible = true;
}

john sun wrote:
samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Can you post your code to us?
Dec 28 '06 #3
Hi,

You cannot do that, a web app could be outside your local network so it will
not have access as a file copy operation.
What you can do is download a remote file; just use the Page.Response you
open your file, set the correct content-type and just pipe the content of
the file to Response.OutputStream
--
Ignacio Machin
machin AT laceupsolutions com

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
>I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore

Dec 28 '06 #4
The file will be located in the same folder as the aspx page. I want to
use the aspx page to copy that file to a location on the users
computer. These users have to log into the website to be able to get to
the page that will allow them to copy the file.

The way you explained it, I did not think we are on the same page with
what I am trying to accomplish.

Scott Moore

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You cannot do that, a web app could be outside your local network so it will
not have access as a file copy operation.
What you can do is download a remote file; just use the Page.Response you
open your file, set the correct content-type and just pipe the content of
the file to Response.OutputStream
--
Ignacio Machin
machin AT laceupsolutions com

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Dec 28 '06 #5


samoore wrote:
The file will be located in the same folder as the aspx page. I want to
use the aspx page to copy that file to a location on the users
computer. These users have to log into the website to be able to get to
the page that will allow them to copy the file.

The way you explained it, I did not think we are on the same page with
what I am trying to accomplish.

Scott Moore
I am not an expert as Ignacio, but my question for you, why don't you
simply let them download the file.

You can simply have them press the button to start downloading the file..

J.W.
>
Ignacio Machin ( .NET/ C# MVP ) wrote:
>Hi,

You cannot do that, a web app could be outside your local network so it will
not have access as a file copy operation.
What you can do is download a remote file; just use the Page.Response you
open your file, set the correct content-type and just pipe the content of
the file to Response.OutputStream
--
Ignacio Machin
machin AT laceupsolutions com

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegr oups.com...
>>I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Dec 28 '06 #6
Hi,

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@a3g2000cwd.googlegro ups.com...
The file will be located in the same folder as the aspx page. I want to
use the aspx page to copy that file to a location on the users
computer. These users have to log into the website to be able to get to
the page that will allow them to copy the file.

The way you explained it, I did not think we are on the same page with
what I am trying to accomplish.
No, we are not. This is cause what you want cannot be done. :)

you have to do as I said before, download the file as you download other
files from the internet.
--
Ignacio Machin
machin AT laceupsolutions com
Dec 28 '06 #7
On 28 Dec 2006 06:08:57 -0800, samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 28 '06 #8
Downloading the file would be fine, I was not sure I could do that with
a Web App. I have tried using OpenDialog with the web app and it will
not allow me. If this can be done with a Web App, can I get a point in
the right direction please.

Scott Moore

Rad [Visual C# MVP] wrote:
On 28 Dec 2006 06:08:57 -0800, samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore

Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 28 '06 #9
samoore wrote:
Downloading the file would be fine, I was not sure I could do that with
a Web App. I have tried using OpenDialog with the web app and it will
not allow me. If this can be done with a Web App, can I get a point in
the right direction please.

Scott Moore
Just use a http link to point to the file. I think that should be enough.
Rad [Visual C# MVP] wrote:
>On 28 Dec 2006 06:08:57 -0800, samoore wrote:
>>I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 28 '06 #10
I have created a hyperlink pointing to the file. When I click on it
nothing happens. Am I allowed to do this for an exe file? I know it
would probably be better to do this for zip file, but that may not be
an option.

Isn't coding fun!

Scott Moore

john sun wrote:
samoore wrote:
Downloading the file would be fine, I was not sure I could do that with
a Web App. I have tried using OpenDialog with the web app and it will
not allow me. If this can be done with a Web App, can I get a point in
the right direction please.

Scott Moore

Just use a http link to point to the file. I think that should be enough.
Rad [Visual C# MVP] wrote:
On 28 Dec 2006 06:08:57 -0800, samoore wrote:

I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #11
On 29 Dec 2006 06:03:44 -0800, samoore wrote:
I have created a hyperlink pointing to the file. When I click on it
nothing happens. Am I allowed to do this for an exe file? I know it
would probably be better to do this for zip file, but that may not be
an option.

Isn't coding fun!
Perhaps we could help you better if we knew exactly what sort of files you
want the user to download. Are they executables? Data files? A mix? How
often are the files downloaded? Weekly? Daily?

--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #12
This is a executable file that at this point would be a one time
download. There is a possibility that this option of downloading files
could be used later on for a mix of files. My main goal right now is to
get this file to download and have it download once.

We have Install Shield Express 5.0 that we use to create CD's. When I
try to use it to create an update patch I always get an error. This is
my second option of trying to find a way to let users update a program.
I need an easy way to do this without to much assistance needed from
the user. Most of the users are not computer savvy.

Scott

Rad [Visual C# MVP] wrote:
On 29 Dec 2006 06:03:44 -0800, samoore wrote:
I have created a hyperlink pointing to the file. When I click on it
nothing happens. Am I allowed to do this for an exe file? I know it
would probably be better to do this for zip file, but that may not be
an option.

Isn't coding fun!

Perhaps we could help you better if we knew exactly what sort of files you
want the user to download. Are they executables? Data files? A mix? How
often are the files downloaded? Weekly? Daily?

--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #13
On 29 Dec 2006 11:00:52 -0800, samoore wrote:
This is a executable file that at this point would be a one time
download. There is a possibility that this option of downloading files
could be used later on for a mix of files. My main goal right now is to
get this file to download and have it download once.

We have Install Shield Express 5.0 that we use to create CD's. When I
try to use it to create an update patch I always get an error. This is
my second option of trying to find a way to let users update a program.

I need an easy way to do this without to much assistance needed from
the user. Most of the users are not computer savvy.

Scott
Is this file being downloaded the executable that the users will run? If so
I suggest you take a look at ClickOnce deployment.

--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #14
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.

Rad [Visual C# MVP] wrote:
On 29 Dec 2006 11:00:52 -0800, samoore wrote:
This is a executable file that at this point would be a one time
download. There is a possibility that this option of downloading files
could be used later on for a mix of files. My main goal right now is to
get this file to download and have it download once.

We have Install Shield Express 5.0 that we use to create CD's. When I
try to use it to create an update patch I always get an error. This is
my second option of trying to find a way to let users update a program.

I need an easy way to do this without to much assistance needed from
the user. Most of the users are not computer savvy.

Scott

Is this file being downloaded the executable that the users will run? If so
I suggest you take a look at ClickOnce deployment.

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 1 '07 #15
On 1 Jan 2007 07:23:32 -0800, samoore wrote:
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.
In that case my good man I suggest you investigate ClickOnce deployment. I
believe that will do what you are looking for.

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 2 '07 #16
Unfortunatly, it looks like the ClickOnce technology is written in 2.0.
We are using 1.1 and I am not sure how soon we are going to move to
2.0, especially since I heard they are coming out with 3.0 and
installing 3.0 will remove 1.1.

If there is any possibility of a different way of doing this, please
let me know after you stop laughing.

Scott

Rad [Visual C# MVP] wrote:
On 1 Jan 2007 07:23:32 -0800, samoore wrote:
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.

In that case my good man I suggest you investigate ClickOnce deployment. I
believe that will do what you are looking for.

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 5 '07 #17
For what it's worth .NET 3.0 doesn't remove .NET 1.1; it shares much of .NET
2.0 but doesn't remove any of the previous runtimes!

- Andy

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@i15g2000cwa.googlegr oups.com...
Unfortunatly, it looks like the ClickOnce technology is written in 2.0.
We are using 1.1 and I am not sure how soon we are going to move to
2.0, especially since I heard they are coming out with 3.0 and
installing 3.0 will remove 1.1.

If there is any possibility of a different way of doing this, please
let me know after you stop laughing.

Scott

Rad [Visual C# MVP] wrote:
>On 1 Jan 2007 07:23:32 -0800, samoore wrote:
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.

In that case my good man I suggest you investigate ClickOnce deployment.
I
believe that will do what you are looking for.

--
Bits.Bytes
http://bytes.thinkersroom.com

Jan 5 '07 #18
On 5 Jan 2007 13:02:20 -0800, samoore wrote:
Unfortunatly, it looks like the ClickOnce technology is written in 2.0.
We are using 1.1 and I am not sure how soon we are going to move to
2.0, especially since I heard they are coming out with 3.0 and
installing 3.0 will remove 1.1.

If there is any possibility of a different way of doing this, please
let me know after you stop laughing.

Scott
Not to worry Scott, no one is laughing.

Well, if I remember correctly .net 1.1 has an earlier equivalent to click
once, i think it's called No touch deployment. It works pretty much in the
same way but you need to do a bit more work yourself, in particular
automating the updates.

Lemme try and find out where I stored links to those resources on my PC and
i'll let you know where you can find more info

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 6 '07 #19
On Fri, 5 Jan 2007 21:16:49 -0000, Andy Bates wrote:
For what it's worth .NET 3.0 doesn't remove .NET 1.1; it shares much of .NET
2.0 but doesn't remove any of the previous runtimes!

- Andy
Just to add on to that, it just goes to show the poor choice Microsoft make
in naming it .NET 3.0 because it is actually .NET 2.0 with a bunch of new
namespaces and classes thrown in, which in effect means .NET 2 is a subset
of .NET 3

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 6 '07 #20

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Mike | last post: by
6 posts views Thread by Wayne Wengert | last post: by
2 posts views Thread by Steve Franks | last post: by
8 posts views Thread by luis molina Micasoft | last post: by
13 posts views Thread by jim | last post: by
1 post views Thread by =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post: by
1 post views Thread by =?Utf-8?B?UmFkZW5rb19aZWM=?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

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.