rejetto forum

Hosting and PDF viewing

0 Members and 1 Guest are viewing this topic.

Offline jffortier

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Hello people !

I use HFS to host JPG and PDF files, a (not so) recent change in ios13 made it impossible to view a PDF file inside a webviewer. Installed of showing the PDF, it will try to download it. The user is asked to download the file. It works, the file get downloaded.

I use Filemaker Go and it relies on the Safari engine in it webviewer. So now a simple URL http://www.myserver.com:80/folder1/folder2/file.pdf that was working before, no longer works. The URL in Safari will ask me to download, in Filemaker, the webviewer is not and I DON'T want the user to be able to download the file (contract archive).

Abode just releases a new API to view a PDF, it works perfectly. The only problem, it’s not working with HFS.

In my log, I see the request for the file, but it never gets download and I have an error in the API preview, can't view preview.

demo of the API https://www.adobe.io/document-services/apis/pdf-embed

Problem with HSF configuration ? The API that is not working with HFS ?

So that we're clear, the URL is not protected with a log in, if I enter this URL http://www.myserver.com:80/folder1/folder2/file.pdf in Chrome, the PDF file gets downloaded.

Thanks


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
it doesn't like something in the hfs answer but it's hard to know what.
if you would know, it could be possible that you can modify hfs answer to comply.
you can try to file this as a big to adobe.
you may also make a test with hfs 3, but beware it's a very different program and you will start from zero
https://github.com/rejetto/hfs/releases


Offline NaitLee

  • Tireless poster
  • ****
    • Posts: 203
  • Computer-brain boy
    • View Profile
There's pdf.js, and it's the pdf viewer built-in firefox. :)
You'll find relative helpful resources on the web, to include pdf.js into the served pages
"Computation is not forbidden magic."
Takeback Template | PHFS


Offline jffortier

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
Thanks, but the new version is also not working  :(
Same, I can type the URL in chrome and the file gets downloaded as previous version.

So the problem must be from Adobe's side ::) and now try to get them to see that problem and fix it!! hoooo boy !!

As for NaitLee suggestion!  :o I will have a look but I'm no web developer, so I have no clue really how to incorporate stuff unless a complete example is published, most of the time they only show a small portion of code that you have to assemble to make it work

Thanks,


Offline jffortier

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I spoke with my web dev and he told me that the HFS server returns a "header : Content-Disposition : attachment"
and this force the download of the file, maybe that tel you something ??

I also notice that new HFS version, the config file, I changed the port from 80 to 8080, but when the program starts, the port display is still 80 and will respond to 80 when I call the server.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
ok you can disable the attachment thing:
Menu > other options > open directly in browser

the port problem with HFS 3 is that it's not clear that the # at the beginning is to disable the line, so your changes are actually ignored.
Remove it.
I will consider this thing for next release.


Offline jffortier

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
BINGO !!

Well the Adobe is still not working, but after seeking thru the other options, I came out to the MIME settings, added *.PDF text/pdf and open in browser when MIME type is define, and now in my iOS device, the simple HTTP URL now open the PDF  ;D no need to have an HTML...

So I might have change the settings and thinking it was iOS13 that change something ??

But now it work like it was before.

Thank you,


Offline jffortier

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
 :'(
Well it works on the iPad now, but when employees are using a laptop with Chrome, Edge... and open the link all we see is this... for a long long page of codes. With download or not the PDF, with the Acrobat extension or not, using Chrome default PDF viewer, all the same results  >:(

%PDF-1.2
5 0 obj
<<
/Type /XObject
/Subtype /Image
/Name /img0
/Width 1278
/Height 1576
/BitsPerComponent 8
/ColorSpace /DeviceRGB
/Filter /DCTDecode
/Length 6 0 R
>>
stream
ÿØÿà�JFIF��–�–��ÿÛ�C�      

 $.' ",#(7),01444'9=82<.342ÿÛ�C          


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
i guess it's because you apparently "invented" a mime type :D
mime types are conventions, so the only way is to google for it.
I did it for you, and apparently for pdf is application/pdf
hope it helps


Offline jffortier

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
I forgot to reply  :o

Yes this was the case, change it from text/pdf to application/pdf and it work  ;D