Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > FileDialog problems on WebClient

Forum

Search UsersRules
FileDialog problems on WebClient
#1
Active user
Points:: 0
Joined:: Dec 4, 2015

Hello,

I have problems with FileDialog on WebClient using Chrome or Mozilla browsers.
Although FileSystemExtension is installed, after file selection, the file cannot be processed because it cannot be found. That means it was not sent to server.

1c:Enterprise platform version tested: 8.3.8.2322, 8.3.9.2033.

Is there any solution to my problem?

Profile
#2
Active user
Points:: 1
Joined:: Nov 24, 2011

Hello. Maybe this code helps U:

Code
&OnClient
Procedure ChoosingFileProcessing(FileName, Parameters) Export
    If FileName<>Undefined Then
        Object.FileName = AdditionalObjects.GetFileName(FileName);
        
        #If Not WebClient Then 

            Digdata = New BinaryData(FileName);
            SendFileToServer(BinaryData);
        #Else

            SendingFiles = New Array;
            SendingFiles.Add(New TransferableFileDescription(FileName, ""));
            SendedFiles = New Array;
            If Not SendFiles(SendingFiles, SendedFiles, , 
                                        False, UUID) Then
                Message("Error sending file: " + ErrorDescription());    
            Else
                SendFileToServer(SendedFiles, True);
              EndIf;    
        #EndIf                                                                 

    EndIf;    
EndProcedure

&OnServer
Procedure SendFileToServer(Datas, CalledFromWeb = False)        
    If CalledFromWeb Then
        FileAddress = Datas[0].Location;
        BinaryData = GetFromTempStorage(FileAddress);
    Else
        BinaryData = Datas;
    EndIf;

    Obj = FormAttributeToValue("Object");
    Obj.Storage = New ValueStorage(BinaryData);
    Obj.Size = BinaryData.Size();
    If Not ValueIsFilled(Obj.Description) Then 
        Obj.Description = Obj.FileName;
    EndIf;        
    Obj.AddingDate = CurrentDate();
    Obj.Write();
    ValueToFormAttribute(Obj, "Object");                   
EndProcedure

Profile
#3
Active user
Points:: 0
Joined:: Dec 4, 2015

Thank you!
I managed to do it using BeginRead() function from TextDocument. I used a notify description and now there are no problems in Chrome, Mozilla and IE.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.