× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



on the server side, you can use the readfile function in php. readfile
will read the file on the IFS and write the contents to stdout. Then you
call the PHP header function to set the HTTP header properties to indicate
that stdout contains an attachment. The readfile documentation contains an
example.
https://www.php.net/manual/en/function.readfile.php

<?php

$file = '/home/doc.pdf';

if (file_exists($file)) {

header('Content-Description: File Transfer');

header('Content-Type: application/pdf');
header('Content-Disposition: attachment;
filename="'.basename($file).'"');
header('Expires: 0');

header('Cache-Control: must-revalidate');

header('Pragma: public');

header('Content-Length: ' . filesize($file));

readfile($file);

exit;

}

?>

on the client side you run javascript code that runs $.ajax ( jquery ) or
fetch ( native javascript ) which calls up to the server, to your PHP
endpoint that runs the readfile code. I can show you that tomorrow if you
need it. There is a javascript PDF library named pdf.js that works well to
render the contents of a PDF file in an HTML5 <canvas> element .
https://mozilla.github.io/pdf.js/

-Steve



On Mon, Jun 8, 2020 at 6:22 PM gio.cot via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi all

Suppose i have some PDF documents in IFS and i would Display/Download them
via browser/http, what i would have to do ? Configure a http instance ? if
yes where can i find a configuration example ?

Thanks in adcance

Gio



--
Questa e-mail è stata controllata per individuare virus con Avast
antivirus.
https://www.avast.com/antivirus
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.