1. Cecilia Jiménez Bedoya
  2. PowerServer 2020 or older (Obsolete)
  3. Monday, 21 January 2019 13:54 PM UTC

Hello! 

I am making a web app, when I click a button I get through a webservice a string with the data of a pdf encoded in base 64.
To be able to show it in the web browser I have to generate the pdf file.
I would like this file to be saved in a web server folder but I do not know how to write to the server with the powerserver.

Another option that I have tried has been generate the file by this way:
ls_file = AppeonGetCacheDir () + '\ plugin \ temp_file_name
li_file = FileOpen (ls_file, StreamMode !, Write !, LockWrite !, Replace!) but this always returns -1.

Could someone tell me why this is failing. And even better, could someone tell me if I can access a server folder and generate the file there.

 

Thank you very much again!!

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 22 January 2019 19:54 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Cecelia;

   Yes, you can build a PB Web Service and just call it from the Web or Mobile App. The WS can build the PDF on the Server side and either use a NativePDF, GhostScript or other 2rd party product to build the PDF. The PDF can be placed on a "Landing Zone" folder or as a Blon in a DB Table on the server side. Your App can either use the iNet object to have it returned to the Web or Mobile device, use a Select Blob or you can use the PowerServer File Transfer mechanism that Marco is talking about.

   If you are interested, I have a full IIS Web Service example that generates a PDF on the server side. The example also has a client app that calls the WS. You can download the full Server PDF Example from here: https://sourceforge.net/projects/stdfndclass/files/Applications/WebService/PDF

HTH

Regards ... Chris

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Tuesday, 22 January 2019 10:02 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Hi Cecelia,

I would use the PowerServer "File Service" plugin:

https://www.appeon.com/support/documents/appeon_online_help/2017/workarounds_and_api_guide/ch01s03s04.html

It allows to upload (and download) files of your choice.

Another possibility would be to deploy, from PB, your own .NET Web Service that receive local files (as blob).

I would go for File Service, it is more handy and easier to integrate in PowerServer.

Best,

.m

Comment
There are no comments made yet.
Cecilia Jiménez Bedoya Accepted Answer Pending Moderation
  1. Tuesday, 22 January 2019 09:15 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3
I found the problem, it was the spaces in the file path. embarassed
Still, is there any way to generate files on the server?

Thank you.
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.