Download, Edit file and then Upload file again

A

abhanjee

Hello,

I am a newbie and am developing an application for work.

I have figured out how to upload a file attachment to the SQL database
and download the same file using C# and Visual Studio. However, the
user wants to download and edit a file and then upload the same file
back to the database (ie overwrite the file). How do I do this?

Also, how to upload/download the file to a network drive instead of
database?

Your help is greatly appreciated.

AB
 
N

Nicholas Paldino [.NET/C# MVP]

AB,

If the file is on the network that you are connected to, then you can
use the static members on the File class to move the file between different
places on the network.

As for editing the file, it depends on what kind of file it is. If you
want the OS to just run whatever app is registered to handle the file, then
you can pass the path of the file to the Process class (specifically, the
static Start method), and it should launch the app, with the file as an
argument to the app (thereby loading the file in the app).

Hope this helps.
 
A

abhanjee

Hello Nicholas,

Thank you for your response. It is helpful. And, yes, I want the OS
to run the application the user downloads ie word, pdf, etc.

Do you have any sample code to upload/download to network and edit, or
is it more or less the same concept as uploading to SQL?

Thank you.

AB

AB,

If the file is on the network that you are connected to, then you can
use the static members on the File class to move the file between different
places on the network.

As for editing the file, it depends on what kind of file it is. If you
want the OS to just run whatever app is registered to handle the file, then
you can pass the path of the file to the Process class (specifically, the
static Start method), and it should launch the app, with the file as an
argument to the app (thereby loading the file in the app).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello,

I am a newbie and am developing an application for work.

I have figured out how to upload a file attachment to the SQL database
and download the same file using C# and Visual Studio. However, the
user wants to download and edit a file and then upload the same file
back to the database (ie overwrite the file). How do I do this?

Also, how to upload/download the file to a network drive instead of
database?

Your help is greatly appreciated.

AB
 
N

Nicholas Paldino [.NET/C# MVP]

AB,

When moving a file on the network, all you have to do is move the file
using the static methods on the File class. It's different from SQL, since
with SQL, you have to read the bytes from the file and write them to SQL
Server.

With files, you can have the OS move the file for you.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello Nicholas,

Thank you for your response. It is helpful. And, yes, I want the OS
to run the application the user downloads ie word, pdf, etc.

Do you have any sample code to upload/download to network and edit, or
is it more or less the same concept as uploading to SQL?

Thank you.

AB

AB,

If the file is on the network that you are connected to, then you can
use the static members on the File class to move the file between
different
places on the network.

As for editing the file, it depends on what kind of file it is. If
you
want the OS to just run whatever app is registered to handle the file,
then
you can pass the path of the file to the Process class (specifically, the
static Start method), and it should launch the app, with the file as an
argument to the app (thereby loading the file in the app).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello,

I am a newbie and am developing an application for work.

I have figured out how to upload a file attachment to the SQL database
and download the same file using C# and Visual Studio. However, the
user wants to download and edit a file and then upload the same file
back to the database (ie overwrite the file). How do I do this?

Also, how to upload/download the file to a network drive instead of
database?

Your help is greatly appreciated.

AB
 
A

abhanjee

Great thank you so much for your input.

Have a good one.


AB,

When moving a file on the network, all you have to do is move the file
using the static methods on the File class. It's different from SQL, since
with SQL, you have to read the bytes from the file and write them to SQL
Server.

With files, you can have the OS move the file for you.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello Nicholas,

Thank you for your response. It is helpful. And, yes, I want the OS
to run the application the user downloads ie word, pdf, etc.

Do you have any sample code to upload/download to network and edit, or
is it more or less the same concept as uploading to SQL?

Thank you.

AB

AB,

If the file is on the network that you are connected to, then you can
use the static members on the File class to move the file between
different
places on the network.

As for editing the file, it depends on what kind of file it is. If
you
want the OS to just run whatever app is registered to handle the file,
then
you can pass the path of the file to the Process class (specifically, the
static Start method), and it should launch the app, with the file as an
argument to the app (thereby loading the file in the app).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello,

I am a newbie and am developing an application for work.

I have figured out how to upload a file attachment to the SQL database
and download the same file using C# and Visual Studio. However, the
user wants to download and edit a file and then upload the same file
back to the database (ie overwrite the file). How do I do this?

Also, how to upload/download the file to a network drive instead of
database?

Your help is greatly appreciated.

AB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top