This topic is locked

upload pdf or doc files

9/19/2007 2:58:48 PM
PHPRunner General questions
J
jetacera author

I want to enable a field to upload a pdf or doc file. I've been able to successfully set a field to upload images, but not pdf or doc. Is there a trick to this? I've tried to use the file/image "Edit As" field type, with and without allowing it to create thumbnails on the fly, but I cannot seem to figure out how to make it allow uploads of anything but image files (jpg and gif).
I see on the View/List pages that I can set the "View as" field type to File or Image, but if I cannot upload the file in the first place, I don't know how this would work.
Please help.
Thanks,
Janet

S
slobbering_dog 9/19/2007

I want to enable a field to upload a pdf or doc file. I've been able to successfully set a field to upload images, but not pdf or doc. Is there a trick to this? I've tried to use the file/image "Edit As" field type, with and without allowing it to create thumbnails on the fly, but I cannot seem to figure out how to make it allow uploads of anything but image files (jpg and gif).

I see on the View/List pages that I can set the "View as" field type to File or Image, but if I cannot upload the file in the first place, I don't know how this would work.
Please help.
Thanks,
Janet


Hi Janet,
Make sure that the underlying field in your table has a data type of 'BLOB' (or similar) that will handle the file you are trying to uplaod.
I have used pdf's quite successfully with PHPR by making the field type as 'File/Image'.
Cheers,
slobbering_dog

Alexey admin 9/20/2007

Janet,
set both View and Edit formats to File.

Then build your project, browse it and use Add or Edit page to upload file.
If this doesn't help please contact support team by support@xlinesoft.com

Send a screenshot that illustrates the issue.

D
Dowdy 10/31/2008

Does the datatype for the file I am uploading, determine if the file is stored in the database or a file system? Another question is if I am storing a PDF file, can PHPR create a thrumbnail of the first page as I have seen in other websites?

Sergey Kornilov admin 10/31/2008

Storage type is determined by the field type. To store files in the database choose binary field, to store as a file choose a text field.
We don't have an option to create PDF thumbnails.

D
Dowdy 10/31/2008

Storage type is determined by the field type. To store files in the database choose binary field, to store as a file choose a text field.

We don't have an option to create PDF thumbnails.


Going by the instruction you had given, I have changed the Field Type to MediumBlob (16mb size) in MySql database.
Since I am just storing PDFs into this document, I thought I would try uploading files to the database. I believe I am missing something for this process.
When I delete the files in the "files" folder then upload the new PDF file thru the form, it wants to copy the PDF to the "files" directory. Is there something I also need to change in the form field?
thanks,

Sergey Kornilov admin 11/1/2008

After changing the field type in the database you need to synchronize PHPRunner project and rebuild it.