How can I browse a file from client then upload to server by using AL?

wolfskinwolfskin Member Posts: 84
Hi everyone,

In C/AL, I used CopyServerFile function in Codeunit "File Management" but it's not work in A/L.
an error occurs like this Error:The type or method 'CopyServerFile' cannot be used for 'Extension' development.
So, there is another way to browse a file from client then upload it to server?


Thanks,

Best Answers

  • wolfskinwolfskin Member Posts: 84
    Answer ✓
    I have been trying to use UPLOADINTOSTREAM function. It's work but I don't know where the file is located.

    Can anyone guild me how do I get the uploaded file?

    Thanks,

Answers

  • Developer101Developer101 Member Posts: 528
    Use streaming functions
    United Kingdom
  • Developer101Developer101 Member Posts: 528
    are you using 365 BC on cloud?
    United Kingdom
  • wolfskinwolfskin Member Posts: 84
    are you using 365 BC on cloud?

    Dynamics NAV 2018 on premise and implement by extension.
  • SanderDkSanderDk Member Posts: 497
    You can also set your target in app.json to internal and use CopyServerFile from codeunit 419.
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • wolfskinwolfskin Member Posts: 84
    Answer ✓
    I have been trying to use UPLOADINTOSTREAM function. It's work but I don't know where the file is located.

    Can anyone guild me how do I get the uploaded file?

    Thanks,
  • wolfskinwolfskin Member Posts: 84
    SanderDk wrote: »
    When you uploadintostream the data is in your stream, not in a file.
    you need to work with your stream instead

    https://docs.microsoft.com/en-us/dynamics-nav/instream

    Thank you for your reply. Now I use DOWNLOADFROMSTREAM function to locate the file from stream.

    Thank you very much,
Sign In or Register to comment.