Script tries to open PDF as pictures

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Script tries to open PDF as pictures

Post by bambinou » 2013-06-24 14:15

Hello,

I have added in the upload parameters:
pdf|jpeg|gif|png

Some will upload the above 4 types of files. I must have them.
Now when I upload a pdf, the script tries to open my pdf as a photo and nothing shows at all in the modal popup, any idea how to fix that please?

Thank you,

Ben

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Script tries to open PDF as pictures

Post by KSan » 2013-06-25 03:05

I suppose this could only work if you were to install a web based pdf reader such as (http://flexpaper.devaldi.com/) and then find a way to have AppGini trigger it when it tries to open a pdf. I am sure it can be done. Just don't know how... :oops:

bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Re: Script tries to open PDF as pictures

Post by bambinou » 2013-06-25 07:13

Hi Ksan,

Thank you for the reply.If AppGini offers the possibility to upload pdf which we cannot open, then I believe this should be classified as a bug.
I will wait for Ahmed's response to see if he will fix it in the next update because following your steps will modify the the scripts and will cause me problem on update.
I prefer to keep the application without any third parties or things become really had to maintain on upload.
Thank you,


Ben

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Script tries to open PDF as pictures

Post by shasta59 » 2013-06-25 13:20

Ben

I have users upload pdf's all the time and it works fine. They open up in a separate page and display exactly as I expect them to. Not sure you would be having this issue. I also have one site where they upload jpg, or pdf, etc and no issues.

I saw your post and tested with a brand new output (clean before I add in my code) and it also worked fine out of the box so to speak. There must be another reason for this happening. I suggest a test where you only allow pdf's. If that works regenerate the app and add in jpg etc and see where it breaks. Also check your server/provider to see if there are any other restrictions. And check your php.ini file to see about file sizes, max upload etc.

While writing this I created a brand new site (only takes a few min to create a basic table with fields) with just one function - upload of many file types and all went fine.

So not sure where your issues are coming from. What size are your pdf's?

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Re: Script tries to open PDF as pictures

Post by bambinou » 2013-06-25 20:26

Hi Alan,

Thank you for your feedback, I will try to only add pdfs now to see if it works as suggested. I will post back here the results.

Thank you,

Ben

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Script tries to open PDF as pictures

Post by shasta59 » 2013-06-25 21:06

Check on your server and see if it is generating a error file at all. If so then the clue may be in there. I have set the server I use for testing to generate a entry into the log file when anything is a bit out of place. Even if the operation works but is slow then it generates an error entry. This has helped me find those hard to find issues.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Re: Script tries to open PDF as pictures

Post by bambinou » 2013-06-25 21:23

Ok, Got it :-)

I clicked on the tick box called "upload image" while setting the various upload format below. I have just worked out that by doing so, the script is awaiting for images only even if other file types are set.

It is working ,

Thank you for your help,

Ben

patricr
Posts: 4
Joined: 2013-06-03 11:58

Re: Script tries to open PDF as pictures

Post by patricr » 2013-11-09 12:04

I am also having problems with pdf files displaying when clicked in the AppGini website I created. I am testing using Ampps on a Mac.

I also cannot get this to work on my Linux production server.

On a Mac, Chrome and Firefox will not display the pdf; Safari will display it, but only one page.

I am using AppGini to create a chemical database for our department and it would be very useful to be able to view all pages of a Safety Data Sheet.

I create a field for the SDS as an image field; set the upload type as pdf, set the size much larger than the largest file size needed.

I have checked the PHP and Apache configs to see if any upload max or file max or timeout max might conflict and can find no problem.

User avatar
a.gneady
Site Admin
Posts: 1287
Joined: 2012-09-27 14:46
Contact:

Re: Script tries to open PDF as pictures

Post by a.gneady » 2013-11-17 21:41

The main issue here is trying to upload a pdf (which is, basically, not treated by browsers as an image) into a field set as an "Image field" ... An image field can handle image files fine by displaying them in an img tag:

Code: Select all

<img src="image_name.png">
... Now, when you upload a pdf into an image field, it would also be displayed into an img tag, because that's what an image field does:

Code: Select all

<img src="doc_name.pdf">"
That won't work of course ... In my opinion, you shouldn't allow pdf and image files to be uploaded into the same field because each is handled differently.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply