Hi,

I am trying to upload a binary file into a shared drive but could not find any solution.

I tried using FileSystems from forge and used File_WriteBinary action to do that task but it ends with a error message when I debug it.



It would be a great help if anyone can help with this.


Thanks in advance.

Hello Ankita,

The error can be found here: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

It means that windows couldn't find the path.

This may be because the path does not exist, is temporarily unavailable or maybe the user used by IIS when interacting with the SO does not have permissions to access this path (like it is not visible to the user). 

What is the path you are using?

Could you show the configuration of the File_WriteBinary?

Cheers.

P.S. By the way, which version of the platform and which version of the FileSystem are you using?
Old versions did not work with shared drives, I think.

If its error 3 it means: The system cannot find the path specified


You probably already knew this, but is this share known from the IIS Users point of View?

It would be better if you could just use the actual path instead of the share.

Eduardo Jauch wrote:

Hello Ankita,

The error can be found here: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

It means that windows couldn't find the path.

This may be because the path does not exist, is temporarily unavailable or maybe the user used by IIS when interacting with the SO does not have permissions to access this path (like it is not visible to the user). 

What is the path you are using?

Could you show the configuration of the File_WriteBinary?

Cheers.


Hello,

Thank you for your reply.

I am using the latest version of outsystems (11.55.44).

As I am new to FileSystems in OutSystems so don't know much about it. 

I can show you what configuration I have done in FileWrite_Binary action.



I actually want to upload the file on my google drive or any other shared location.

First I tried to write the path in double quotes but Still there was similar error (ex:

SyntaxEditor Code Snippet

"C:\OneDrive\OutSystems"

)

Thank you


Hello Ankita,

If I am not wrong, I remember that now it is not possible to upload files to the application folder anymore? Hence the error.

If you wants to upload to a shared path, the IIS user for the OutSystems application must have access to it, and the syntax will be: \\Domain\Shared Folder\

Regarding sending files to GoogleDrive and so on, the better is to use a component from forge for that, like this one: https://www.outsystems.com/forge/component-overview/364/google-drive-connector

Hope this helps.

Cheers.

P.S. You CAN'T upload files to your own computer (C:\OneDrive\OutSystems).

Remember, you are sending the file to the "server". If you want to send to your OneDrive, you need a similar approach as to the GoogleDrive, like https://www.outsystems.com/forge/component-overview/1010/onedrive-connector or https://www.outsystems.com/forge/component-overview/5552/microsoft-graph-connector

Cheers.

Hi Ankita,

first i want ask you whic platform you using mean OnPremises or Cloud.

if you are using cloud than cannot  get access direct path of cloud platform.Because "Path_GetApplicationDirectory" return path of where your espace running 

like-

 "c/programfile/outsystem/platformserver/running/espacename.randomnumber "

and i assume shared drived can not  access directly.

if you are using OnPremises than you can upload you document on specific drive and get from same.

 

On cloud-

Follow this steps to put file on server path and get file from same 

  1. Use action  Path_GetApplicationDirectory
  2. Check Directory_Exists with folder name Like -Path_GetApplicationDirectory.ApplicationDirectory+"\TempFolder" 
  3. If Directory not exist than directory     create else not  
  4. After use     Path_GetDirectoryName action
              like -  Path_GetApplicationDirectory.ApplicationDirectory+"\TempFolder\Images" 
  5. Use File_WriteBinary provide file content and     path  with file name like -Path_GetDirectoryName.DirectoryName+"\"+Upload1.Filename



 

For Getfile from server-


  1. Use action  Path_GetApplicationDirectory
  2. Provide file name like 

       Path_GetApplicationDirectory.ApplicationDirectory+"\TempFolder\"+FileName 

  1. Use      File_ReadBinary action 
  2. Use download action

 


If you want to getlist of file from same directory Use "Directory_ListFiles"Actions.

 Hope this will help you.

Thanks

Rahul Sahu

Be careful putting files on temporary folders... 

Rahul Sahu wrote:

Hi Ankita,

first i want ask you whic platform you using mean OnPremises or Cloud.

if you are using cloud than cannot  get access direct path of cloud platform.Because "Path_GetApplicationDirectory" return path of where your espace running 

like-

 "c/programfile/outsystem/platformserver/running/espacename.randomnumber "

and i assume shared drived can not  access directly.

if you are using OnPremises than you can upload you document on specific drive and get from same.

 

On cloud-

Follow this steps to put file on server path and get file from same 

  1. Use action  Path_GetApplicationDirectory
  2. Check Directory_Exists with folder name Like -Path_GetApplicationDirectory.ApplicationDirectory+"\TempFolder" 
  3. If Directory not exist than directory     create else not  
  4. After use     Path_GetDirectoryName action
              like -  Path_GetApplicationDirectory.ApplicationDirectory+"\TempFolder\Images" 
  5. Use File_WriteBinary provide file content and     path  with file name like -Path_GetDirectoryName.DirectoryName+"\"+Upload1.Filename



 

For Getfile from server-


  1. Use action  Path_GetApplicationDirectory
  2. Provide file name like 

       Path_GetApplicationDirectory.ApplicationDirectory+"\TempFolder\"+FileName 

  1. Use      File_ReadBinary action 
  2. Use download action

 


If you want to getlist of file from same directory Use "Directory_ListFiles"Actions.

 Hope this will help you.

Thanks

Rahul Sahu

Hi Rahul,

Still Same error is coming that path is not found.   I am not getting what wrong I am doing. 




Please Help

Still saying: If you get this error it means either the directory doesnot exist, or you don't have access to it (you = IIS Server user).


Do you have a path on the OS server you know exists for sure? Please try that one.

Stefano Valente wrote:

Still saying: If you get this error it means either the directory doesnot exist, or you don't have access to it (you = IIS Server user).


Do you have a path on the OS server you know exists for sure? Please try that one.


hi,

I didn't get you. Can you please explain a bit. As i am new to FileSystems so don't know much. Or suggest me any tutorial from where I can learn more about fileSystems.

Thank you

Ankita Jaggi wrote:

Stefano Valente wrote:

Still saying: If you get this error it means either the directory doesnot exist, or you don't have access to it (you = IIS Server user).


Do you have a path on the OS server you know exists for sure? Please try that one.


hi,

I didn't get you. Can you please explain a bit. As i am new to FileSystems so don't know much. Or suggest me any tutorial from where I can learn more about fileSystems.

Thank you


The first time i used the FileSystems component i didn;t know the folderstructure of our OS server (cloud). So i first got all files and folders from the C drive, because it always exists. That got me an exception because the IIS user does not have permission to access the recycle bin.


Just trying to say: Look from the perspective of the IIS user, being logged on on the cloud server. Filesystem component is used to access files from that server, only from locations that user has access to.


Looking at your example, you try to access ApplicationDirectory + \Tempfolder\Images

My questions are: 

1- Does that location exist?

2- Does the IIS User have access to it?


The Tempfolder does exist, looking at your example. Can you get a list of all files in that directory or do you get the same win32 error?.



Stefano Valente wrote:

Ankita Jaggi wrote:

Stefano Valente wrote:

Still saying: If you get this error it means either the directory doesnot exist, or you don't have access to it (you = IIS Server user).


Do you have a path on the OS server you know exists for sure? Please try that one.


hi,

I didn't get you. Can you please explain a bit. As i am new to FileSystems so don't know much. Or suggest me any tutorial from where I can learn more about fileSystems.

Thank you


The first time i used the FileSystems component i didn;t know the folderstructure of our OS server (cloud). So i first got all files and folders from the C drive, because it always exists. That got me an exception because the IIS user does not have permission to access the recycle bin.


Just trying to say: Look from the perspective of the IIS user, being logged on on the cloud server. Filesystem component is used to access files from that server, only from locations that user has access to.


Looking at your example, you try to access ApplicationDirectory + \Tempfolder\Images

My questions are: 

1- Does that location exist?

2- Does the IIS User have access to it?


The Tempfolder does exist, looking at your example. Can you get a list of all files in that directory or do you get the same win32 error?.




Hi,


When I used Directory_ListFiles action then also I got error mesaage


What should be done ? Please suggest