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

wolfskinwolfskin Posts: 55Member
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 Posts: 55
    Accepted 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 Posts: 351Member
    Use streaming functions
    United Kingdom
  • Developer101Developer101 Posts: 351Member
    are you using 365 BC on cloud?
    United Kingdom
  • wolfskinwolfskin Posts: 55Member
    are you using 365 BC on cloud?

    Dynamics NAV 2018 on premise and implement by extension.
  • SanderDkSanderDk Posts: 177Member
    You can also set your target in app.json to internal and use CopyServerFile from codeunit 419.
    For help, do not use PM, but use forum instead, perhaps other people have the same question, or better answers.
  • wolfskinwolfskin Posts: 55Member
    Accepted 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 Posts: 55Member
    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.