How open a PDF file clicking on a Form Button ??

Hello all,

I got to open an external file (like help file) clicking on a button “HELP” on a form .
Which is best and easy solution ??
Many thanks

sc_redir(“full_or_relative_url_to_your_pdf_file”,’’,’_blank’);

GREAT !!! Tomorrow morning I’ll try.
As directory is better to use and save the pdf file under SC default doc folder
So when I call it from my application need I to use …/…/_lib/file/doc/name_of_file.pdf …

I lways make confusion between these folders… why img are in two places ? Is the _lib/img only for applications images… ? and /public_html/eosb2b/_lib/file/img for the images stored during the use of the project ? Is only that the difference ?

/public_html/eosb2b/_lib/file/img
/public_html/eosb2b/_lib/img/

For doc I think is better to use this one /public_html/eosb2b/_lib/file/doc

Hello Giu,
a did this test.
I put the file under localhost: C:\Program Files (x86)\Scriptcase\v8_new\wwwroot\scriptcase\file\doc\eos_sales_doc\COND_GEN_FORNITURA_LUGLIO15.pdf

I need that once deployed the sc_redir works properly. I think I have to use relative path

sc_redir("…_lib\file\doc\eos_sales_doc\COND_GEN_FORNITURA_LUGLIO15.pdf",’ ‘,’_blank’);

It seems to try to open the file (I suppose…) but this is the error

Forbidden

You don’t have permission to access /scriptcase/app/B2B_B2C/…_libiledoceos_sales_docCOND_GEN_FORNITURA_LUGLIO15.pdf/…_libiledoceos_sales_docCOND_GEN_FORNITURA_LUGLIO15.pdf.php on this server.

if I use instead

sc_redir("…/…/…/_lib/file/doc/eos_sales_doc/COND_GEN_FORNITURA_LUGLIO15.pdf",’ ‘,’_blank’);

The error is

Not Found

The requested URL /scriptcase/_lib/file/doc/eos_sales_doc/COND_GEN_FORNITURA_LUGLIO15.pdf was not found on this server.

It’s a classic !!! When you go to mechanic the car always do not show the problems you got till one minute before !!! :wink:
The following works !!!

sc_redir(’…/…/…/file/doc/eos_sales_doc/COND_GEN_FORNITURA_LUGLIO15.pdf’,’_blank’);

This open the doc _lib has to be jumped… (don’t know why) .

When I’ll run it on production server I need to have a different page becouse otherwise I can’t close the pdf only. Is _blank the right choice ??

_blank is to open in another page, but buttons has too a target property, defining where should be executed.

Before, didn’t worked because URL in PHP is with / not . Between " (double quote), in PHP \ is an escape character. For example,
is new line
On dev …/_lib doesn’t exists because prod enviroment is not inside project code.