Results 1 to 4 of 4

Thread: Save image path in database

  1. #1
    Join Date
    Dec 2010
    Posts
    20
    Thanks
    9
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Save image path in database

    Hi all, hope u could help me to solve this.

    The database for my application is located in another PC. Assume it is "\\server\database.mdb". I also save some images in folder "\\server\images\".
    Then I want to add an image from another PC to the database. I take out a full image file path, assume "D:\img\example.jpg", with some modification I finally got "\\server\images\example.jpg". I add this path to "database.mdb" and make a copy from "D:\img\example.jpg" to "\\server\images\example.jpg". Until this everything is working fine. So when I want to acces the image I just use "\\server\images\example.jpg".

    ( I am using windows, and I share "\\server\" folder, so that everyone can access it )

    The problem is my user want to make "\\server\images\" can't be opened from windows explorer.
    I am thinking about using TCPSocket with client and server, but a lot of effort will be needed.

    Can I just make "\\server\images\" can only be accessed from my qt application?

  2. #2
    Join Date
    Nov 2010
    Posts
    82
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Save image path in database

    use http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    to make sure you can access the network pass first

  3. The following user says thank you to Le_B for this useful post:

    rivci (4th May 2012)

  4. #3
    Join Date
    Dec 2010
    Posts
    20
    Thanks
    9
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Save image path in database

    wow.. seem complicated to me.

    I finally decide to use postgresql and save the images to database hahaha thanx again

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Save image path in database

    Make sure that you are correctly escaping all those backslashes in any literal path you have embedded in your program:
    Qt Code:
    1. QString basePath = "\\\\server\\images";
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 19
    Last Post: 8th August 2011, 09:11
  2. Read image and save to database?
    By Gokulnathvc in forum Newbie
    Replies: 6
    Last Post: 22nd July 2011, 00:18
  3. how to save a image file ( say png ) into mysql database?
    By AviMittal in forum Qt Programming
    Replies: 12
    Last Post: 21st July 2011, 12:49
  4. how to save database
    By khalid_se in forum Newbie
    Replies: 7
    Last Post: 10th July 2011, 18:47
  5. Save images to database
    By jnk5y in forum Qt Programming
    Replies: 4
    Last Post: 8th May 2006, 19:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.