Source language: Translate to:

Store a file in Picture filed

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Store a file in Picture filed

Postby smartmedia » Mon Oct 06, 2008 11:05 am

Hi...

I am facing a problem and i need your help.
I using a picture field in MDB database to store files inside.
Storing images inside Picture field is working.
When i try to store other file type, for example a Text file made from Notepad or a Report file, at the end of file, NBDBP inserts this characters in Report file Image and the same in text file with txt at the end.

Obviously when i use the variable from database to open the report i get invalid format type.
I understand that this is used to keep internally the extension of the file, my question are:
This is a bug...??? if yes can be fixed right away because i ready to rellease an application that use stored reports inside the database.
If not how i will store report files inside without to be modified.

Thanks
Last edited by smartmedia on Tue Oct 07, 2008 12:05 am, edited 1 time in total.
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Gaev » Mon Oct 06, 2008 11:55 am

smartmedia:

I haven't tried to replicate your situation ... so I can't vouch if there is a bug or not ... however ...

- instead of storing text files in the database Tables, why not store the (text) contents in a (text) field ... then, instead of Exporting the file, you can do a FileWrite of the contents of this field within the record.

- may not work for .dbr files ... as I do not believe they are true text files ... but you might consider changing their extension to something like .jpg or .smartdbr ... see if that makes NeoBookDBPro handle the file like the image (or other binary) files.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby smartmedia » Mon Oct 06, 2008 12:13 pm

Hi...

Gaev, i don't care about the text files, i care for DBR files and actually the problem exist also in jpg files but NB dosen't seem to care about that when present the photo. If you have time can you please check it your self and post the results...???
Because every time i post something i feel that i am the only one that facing all this problems. I feel like i am from Mars and nobody understand me.
Thanks again...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Wrangler » Tue Oct 07, 2008 8:28 am

Is there any particular reason why the dbr has to be stored in the DB? Did you try renaming the dbr extension to something else like Gaev suggested?
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Neosoft Support » Tue Oct 07, 2008 12:22 pm

The suffix added to the end of the picture field data is required for DBPro to correctly detect the file type because the blob format does not retain this information. Most applications will ignore extra bytes added to the end of a document, but DBPro's Report Designer apparently does not. This hasn't been an issue until now, but I will add your post to our list of things to look into for the next update.

Because every time i post something i feel that i am the only one that facing all this problems. I feel like i am from Mars and nobody understand me.


It may be that you're using the plug-in in ways that other people are not. That doesn't mean that your problems are not real, but they are not always easy to understand or reproduce.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby David de Argentina » Tue Oct 07, 2008 2:35 pm

Hi,

Store images is.. usually.. a pain in the neck.

I suggest you encode the image file before save them (HPWUtility has a function to do this) and decode this after you export encoded image to a intermediate file...

Is pretty slower... but much more stable...

My devaluated cent,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby smartmedia » Tue Oct 07, 2008 11:50 pm

David de Argentina wrote:Hi,

Store images is.. usually.. a pain in the neck.

I suggest you encode the image file before save them (HPWUtility has a function to do this) and decode this after you export encoded image to a intermediate file...

Is pretty slower... but much more stable...

My devaluated cent,
David de Argentina

David,

The situation is with every file trying to insert in database. I like the fact that you be able to "remember" the extension of the file you insert inside but i thinking also the possibility of violate the contains of the file entering such informations.
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby David de Argentina » Wed Oct 08, 2008 7:56 am

Hi SmartMedia

If you define the table structure, you can create a text field in order to save the filename.ext of each file to store into the blob field

My devaluated cent,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests