Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save image

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi

I want to create an employee table which contains fields related information. I want to add fields to save images for the following:

1. Employee image
2. Passport Copy
3. Visa Copy
4. Identity Card and,
5. Medical Card

What is the best way to do so? If I store all these in a table, will it be bulky? Or should I save in somewhere in app path and provide a link.

Please guide...

Thanks

Saif
 
You should NOT save pictures in the table.
Save it somewhere what they can be accessible for ALL users (maybe in sub-folder of your DATA folder)
and save only the path to them.

Borislav Borissov
VFP9 SP2, SQL Server
 
I agree completely with Borislav. And I would add that you don't need to store the entire path to the image files. If all the images are in the same directory, just store the filenames.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
A second all this. And if all file names are not only in a specific folder \\fileshare\yourdata\images, but also have a specific name pattern like employee<ID>.jpg for employee, passport<ID>.jpg for passport, etc. you even don't need to store the file name, but create the name from the record ID via TRANSFORM and/or TEXTMERGE.

Be warned Windows Explorer gets very sluggish with folders having thousands of files, so depending on the record amount I'd make parent folders with the digits of the ID/1000, eg employee ID 12345 would have his pics as \\fileshare\yourdata\images\12\employee12345.jpg etc.

Bye, Olaf.
 
Thanks for the reply!

I will do the same, but can you guide me how can I access the images of the employees by using the four buttons like Top, Previous, next, bottom?
I saved all the images in the same directory ('\graphics\staff') of application.

Thanks

Saif
 
Your navigation buttons should all trigger a form.REFRESH() event to which you can and must react by setting image controls to the pictures belonging to the current record.

Bye, Olaf.
 
If stored in a separate files and visible on the disk, anybody on the network could make identity theft. To resolve, you could add some bytes to the images such that they become scrambled and only your program can decode them. Or find some other methods such that others can not view the .jpeg/.pdf files.

Second choice: Create two tables for employee (employeeT.dbf, employeeIxx.dbf), where first will contain text data and second image data. Setup a relation between employeeT and employeeIxx.dbf. xx in the file names span from 00 to 99. The relation need to be updated every time there is a new employeeIxx.dbf file. This is just an idea.

nasib
 
Nasib, you're implying a safety DBF (or FPT) embedded images have. If users can access a dbf it's merely the download of a dbf viewer and they can also get at the images. If you can't trust against theft you'd need to move from DBF overall.

Bye, Olaf.
 
Nasib,

this criticism was about your second choice. Your first solution would work, eg encryption of data is a way to make DBFs unusable without an application knowing the decryption. Cryptor would be a third party tool to use for that, not only for DBFs, any file can be encrypted and registered for decryption.

Anyway, if someone wanted some emplyees pic, a screenshot of the application is all, that's needed for that matter.

Data safety in terms of the safety against theft is a very vast and separate topic.

Bye, Olaf.
 
If stored in a separate files and visible on the disk, anybody on the network could make identity theft.

If you took that argument to its logical conclusion, no-one would ever post pictures of their employees on their websites; or pictures of themselves in their blogs or Facebook pages.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
True, Mike

Anyway, the specific pictures of employees are identifying them on identity cards, corporate documents more specific than any facebook or other public picture. In the end if you aim to create a duplicate of an identity card of a not well known employee, you'd copy all identity information and access privilieges which may be stored on a magnetic stripe and replace the employee pic with one of your
s, so even when you're checked by some night doorman, you'd be able to pass through.

You can also argue people publish very many private things, and the NSA has all these pictures anyway. But that doesn't unbind you from any laws about privacy and to handle personal data with all needed discretion.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top