Can not read file content from 1C web app hosted in the cloud

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

I am trying to read content of text file selected from local computer from my 1C web app hosted in the cloud using methods FileStreams.OpenForRead(Filename) or New BinaryData(Filename) and I get an error message "[ScriptRuntimeError, ScriptUseError], reason: Directory not found". What can be the reason?
If I launch my web app from localhost everything works fine.

 
#2
People who like this:0Yes/0No
Administrator
Rating: 29
Joined: Oct 3, 2019
Company:

Hey Peter,

let me some time pls - I'll create a small example how to work with files in web client in 1C

 
#3
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

I solved already this problem. Here's the solution:
Stream = Await FileStreams.OpenForReadAsync( Filename );
FileReader = New DataReader( Stream, TextEncoding.UTF8 );  
FileContent = Await FileReader.ReadCharsAsync( , TextEncoding.UTF8 );

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.