• Welcome to SQLitening Support Forum.
 

News:

Welcome to the SQLitening support forums!

Main Menu

pictures

Started by D. Wilson, August 13, 2016, 03:27:37 PM

Previous topic - Next topic

D. Wilson

I am working on a project that deals with lots of pictures. I have no problem adding/saving them to a sqlite database through sqlitening. The question I have is this....

Is it possible to save the picture files in a directory where the sqlite database is saved  (under a different directory) and retreive the file when needed through the sqlitening server.

I am already keeping the pictures in a seperate database. But I am thinking about back ups that having the images seperate would allow easier backups. Since I only have to backup the changes.

Any thoughts or help would be greatly appreciated.

cj

#1
I suppose you would need a separate entry for each file in the FACT.
If you have trouble with this it shouldn't be too hard to modify the server to allow a folder.

It sounds like you are doing this only because the size of the picture table or database is huge.
In that case,  maybe ATTACH to separate databases that are created daily/weekly/monthly or the like.

slGetFile / slPutFile

--- Local Mode ---
If the FileName is not fully pathed then it is assumed to be relative to the current folder which is the same folder, unless changed by chdir, that the first .Exe was run from. If fully pathed then no assumptions are made. Since this running on a local computer SQLitening allows the files to be located anywhere on the local hard drives or local network drives.


Examples:
If your .Exe started in C:\Apps\MyApp then:
1.   If FileName is X\Y\Able.Sld then will assume file is in C:\Apps\MyApp\X\Y.
2.   If FileName is ..\Y\Able.Sld then will assume file is in C:\Apps\Y.
3.   If FileName is C:\Able.Sld then no assumption.


--- Remote Mode ---
The FileName is assumed to be relative to the folder which the service is running from.  Since this is running on a remote server SQLitening can not allow the user to access files anyplace on the server.  Access is denied to any FileName that has a colon, a double dot, or begins with a backslash. This will insure that the file is in same folder as the service or below it. Access is denied to files that are in the Temp folder (contains the Row Data Chunk overflows), any file whose extension is Exe, .Dll, .Log or .Cfg that reside in same folder as the service. Also for security reasons, all files must be included in the FACT  of the server config file. This is because of the damage that can be done due to a coding error with PutFile.


Examples:
If your service is running from C:\SQLitening then:
1.   If FileName is Data\Able.Sld then will assume file is in C:\SQLitening\Data.
2.   If FileName is ..\Y\Able.Sld then will get error -8 Access Denied.
3.   If FileName is C:\Able.Sld then will get error -8 Access Denied.
4.   If FileName is Able.Exe then will get error -8 Access Denied.
5.   If FileName is Temp\Goffy.Sld then will get error -8 Access Denied.