Create, download and save file from Web Portal

Hi all

My client wants me to add a button in the Web Portal to allow him to create a plain .txt report with certain data.

Currently I’m trying to use a “Data Action” -> “Save File” control, that seems to me to be the right choice.

The control “Safe File” shows 3 params:

               File Name

               Append to file

               Value (file content)

I provide the control with all the params but when I compile the solution it keeps telling me

“No overload for method 'SaveToFile' takes 2 arguments “

When I edit the C# code behind, it seems the param “bool append” is missing and I can’t find an solution to pass it to the function VI.WebRuntime.WebSql.SaveToFile that raises the exception.

Please, any suggestions?

Parents
  • Hi Alberto,

    What you describe sounds like you want the user to be able to download data. The "save file" action saves a file on the server side. Check the "download file" node type.  Are you sure which one you need?

    Hope this helps,

    Hanno

  • Thanks Hanno

    that's good to know. 

    I’m pretty new in OI so I don’t know all controls’ behavior. Anyway I need to download a file, but when the user presses the button I need to create it firstly. That’s the reason I thought to use “save file” than, in case, “download file”.

    Instead, after a better look to “download file” I saw I can pass the file content as byte[] just selecting “collection” in the “source” field. That’s what I wanted! Blush

    now evereything is working fine.

    Thanks again

    Alberto

Reply
  • Thanks Hanno

    that's good to know. 

    I’m pretty new in OI so I don’t know all controls’ behavior. Anyway I need to download a file, but when the user presses the button I need to create it firstly. That’s the reason I thought to use “save file” than, in case, “download file”.

    Instead, after a better look to “download file” I saw I can pass the file content as byte[] just selecting “collection” in the “source” field. That’s what I wanted! Blush

    now evereything is working fine.

    Thanks again

    Alberto

Children
No Data