Download file from BLOB field

A place for users and developers of the Xataface to discuss and receive support.

Download file from BLOB field

Postby transcan » Fri Jul 23, 2010 7:08 am

When uploading a file (word, pdf, xls, etc.), it appears to work. When checking the field, mysql displays gobbledygook. However, when trying to download by clicking on "View Field Content in New Window", a new tab is opened in the browser showing only a blank page. No prompts to save the file, or the file is not automatically opened such as a pdf.

I've added:

Code: Select all
[binary]
Type = blob
widget:type = file


Another thread mentioned adding mime provisioning, or editing the blob.php file. Another one mentioned adding code to handling file names for the file uploaded.

What are the proper steps to allow for saving and then retrieving a file of any kind when using the BLOB/upload/download feature?

Thanks in advance.
transcan
 
Posts: 13
Joined: Wed Jul 21, 2010 11:57 am

Re: Download file from BLOB field

Postby jvinolas » Sun Aug 01, 2010 3:12 am

I also noticed that an update pf 'PDFOutline' field lets the user choose new file, but image is not updated even the PDFOutline_mimetype and PDFOutline_filename are updated correctly.

Has it something to do with cache?
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am

Re: Download file from BLOB field

Postby shannah » Wed Aug 11, 2010 9:58 am

You may need to just hit refresh in the browser because it will be loading the image from the identical URL - so your browser probably still has the old one cached.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Download file from BLOB field

Postby cookie720 » Wed Jun 13, 2012 11:02 pm

Clicking to "View Field Content In New Window ()" Doesnt work, I tried refreshing too.
Can save the file from phpmyadmin but does not display in my details view, and not in the list either.
cookie720
 
Posts: 69
Joined: Mon Jun 04, 2012 9:22 pm

Re: Download file from BLOB field

Postby cookie720 » Mon Jun 18, 2012 1:02 am

Still trying all different kinds of ways, sadly nothing is working. Cannot even see one pixel of image :(
Please help XF gurus!
cookie720
 
Posts: 69
Joined: Mon Jun 04, 2012 9:22 pm

Re: Download file from BLOB field

Postby PolderBoy » Mon Jun 18, 2012 7:52 am

Hello,

I solved it by not using a blob field. The uploaded file adres is saved in the database.
part of the tablename.ini file:

[File_VL]
Type = container
widget:type = file
allowed_extensions = wav
savepath = /home/administrator/www/tables/tablename/VL
url = /tables/tablename/VL

Not the answer you were looking for, I know.
PolderBoy
 
Posts: 72
Joined: Fri Apr 03, 2009 12:53 am

Re: Download file from BLOB field

Postby cookie720 » Mon Jun 18, 2012 8:25 am

So the container is just a varchar which stores the url, how do we set this up in mysql?
I want to have one photo per client.

- I deleted all files from my client table folder and it is working, my images (BLOB) are appearing. As soon as I put my client.php delegateclass file back in, the image dissapears........
cookie720
 
Posts: 69
Joined: Mon Jun 04, 2012 9:22 pm

Re: Download file from BLOB field

Postby PolderBoy » Tue Jun 19, 2012 12:31 am

Hello,

There are two ways you can do this.
One is to save the image as a blob in the database. (makes the database bigger)
The other is a more simple way and that is to save the file adres as a varchar in the table and upload the files (images) in a folder.

But you say:
- I deleted all files from my client table folder and it is working, my images (BLOB) are appearing. As soon as I put my client.php delegateclass file back in, the image dissapears........

That means that there is a error in your class.
Could you show the client.file?

Brian
PolderBoy
 
Posts: 72
Joined: Fri Apr 03, 2009 12:53 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved