Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Save Physical File using MySQL

Save Physical File using MySQL

Scheduled Pinned Locked Moved C#
databasemysqlcomsysadminquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, I am using MySQL for employee WinForm application. Some tables have images and Ia m currently saving it as blob which is killing the size of the database. I want now to move it to a varchar field contains the file name or ID and save the physical file on the server instead of blob. I want to know what's the best practice in this? Do I need to include FTP server and client in my application? Is it possible to send the file with the database SqlConnection but receive it there in the server as physical file? Please assist.. Thanks, Jassim[^]

    Technology News @ www.JassimRahma.com

    OriginalGriffO 1 Reply Last reply
    0
    • J Jassim Rahma

      Hi, I am using MySQL for employee WinForm application. Some tables have images and Ia m currently saving it as blob which is killing the size of the database. I want now to move it to a varchar field contains the file name or ID and save the physical file on the server instead of blob. I want to know what's the best practice in this? Do I need to include FTP server and client in my application? Is it possible to send the file with the database SqlConnection but receive it there in the server as physical file? Please assist.. Thanks, Jassim[^]

      Technology News @ www.JassimRahma.com

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      No - the simplest solution is to create an "employee photo" folder on the server, and share it, giving read-only access. Your client apps then read the file name from the DB and access the share directly: Access to remote folder[^]

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      J 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        No - the simplest solution is to create an "employee photo" folder on the server, and share it, giving read-only access. Your client apps then read the file name from the DB and access the share directly: Access to remote folder[^]

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

        J Offline
        J Offline
        Jassim Rahma
        wrote on last edited by
        #3

        but the folder will also have confidential documents such as contracts and warning letters for employee and giving read only access will allow users to view every file stored in it.

        Technology News @ www.JassimRahma.com

        P M 2 Replies Last reply
        0
        • J Jassim Rahma

          but the folder will also have confidential documents such as contracts and warning letters for employee and giving read only access will allow users to view every file stored in it.

          Technology News @ www.JassimRahma.com

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          You don't give the users the permissions to view the folder by default. Instead, have a server based application or a Web API retrieve the documents and have that with the appropriate permission. Then you back this up with access control for the user against that service.

          This space for rent

          1 Reply Last reply
          0
          • J Jassim Rahma

            but the folder will also have confidential documents such as contracts and warning letters for employee and giving read only access will allow users to view every file stored in it.

            Technology News @ www.JassimRahma.com

            M Offline
            M Offline
            Mycroft Holmes
            wrote on last edited by
            #5

            Create a folder for specific document types, employee photos, contracts, correspondence etc Or do as POH suggested and create a service, this is the preferred method as it removes the client access directly to the server. However this would require you to reengineer you data access :sigh:

            Never underestimate the power of human stupidity RAH

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups