-2

How I can upload image or files to folder in local server C# Windows application? I prefer this method instead of saving the images to the database because it makes heavy.

I am using Windows Server 2008, please help me to get articles or tutorials to accomplish this.

4444
  • 3,541
  • 10
  • 32
  • 43
  • possible duplicate of [Storing Images in DB - Yea or Nay?](http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay) There are some useful hints on how to save images. – jAC Jul 12 '13 at 16:26
  • 1
    Very unclear what your problem is. `copy MyFile.png \\server\share\` should be more than enough... – Alexei Levenkov Jul 12 '13 at 16:26

2 Answers2

5

The best way, IMO, would be to use FTP. See here for an example of how to do that.

Note, that you will need a good FTP server running on your server computer (I, personally, like FileZilla.

ANOTHER (likely easier) way would be to use SMB. You would have to open up a SMB share on the server for the folder which you want to upload the image too. this question has some example code of how you upload a file using SMB.

Community
  • 1
  • 1
HangBot
  • 84
  • 1
  • 4
1

I do not advise saving images to the database. Make a directory folder somewhere named images, place your images there. You can save the image paths and names to the database, or hard code them if they aren't going to change.

It's easy to manage that way, less unnecessary database connections as well.

You can use an FTP or place the images directly in the folder on your server.

Here is some helpful reading for you:
Storing Images in DB - Yea or Nay?
storing images in database or on hard drive

Community
  • 1
  • 1
prospector
  • 3,389
  • 1
  • 23
  • 40