Upload did not complete within the 65 seconds time limit.
The maximum file size is 350 MB.
If the file contains an image, consider reducing the size or quality of the image before uploading. If the file is an archive, consider splitting this into smaller archives if these can be uploaded individually. For other large files, consider linking to the file on an external document repository instead.
procedure LoadZIPFile(ZipFileName: Text; var TotalCount: Integer; ReplaceMode: Boolean): Text var Item: Record Item; FileMgt: Codeunit "File Management"; DataCompression: Codeunit "Data Compression"; TempBlob: Codeunit "Temp Blob"; Window: Dialog; EntryList: List of [Text]; EntryListKey: Text; ServerFile: File; InStream1: InStream; EntryOutStream: OutStream; EntryInStream: InStream; ServerFileOpened: Boolean; Length: Integer; Variant_No: Text; Rec_MyDocumentAttachment: Record "My Document Attachment"; rec_DocuUpload: Record "Look Up Doc Attach"; OutS: OutStream; "File Name_L": text; "File Extesion_L": Text; "File Size (KB)_L": Integer; Item_L: Text; begin rec_DocuUpload.Reset(); Clear(rec_DocuUpload); if not UploadIntoStream('Variant ZIP Files', '', 'Zip Files|*.zip', ZipFileName, InStream1) then Error(''); DataCompression.OpenZipArchive(InStream1, false); DataCompression.GetEntryList(EntryList); Window.Open('#1##############################'); TotalCount := 0; DeleteAll(); foreach EntryListKey in EntryList do begin Init(); "File Name_L" := CopyStr(FileMgt.GetFileNameWithoutExtension(EntryListKey), 1, MaxStrLen(Rec."File Name")); "File Extesion_L" := CopyStr(FileMgt.GetExtension(EntryListKey), 1, MaxStrLen(Rec."File Extension")); TempBlob.CreateOutStream(EntryOutStream); DataCompression.ExtractEntry(EntryListKey, EntryOutStream, Length); TempBlob.CreateInStream(EntryInStream); "File Size (KB)_L" := Length; TotalCount += 1; rec_DocuUpload.Reset(); Clear(rec_DocuUpload); rec_DocuUpload.SetCurrentKey(rec_DocuUpload.File_Name); rec_DocuUpload.SetRange(Transaction_Type, rec_DocuUpload.Transaction_Type::"Purchase Order"); rec_DocuUpload.SetRange(File_Name, "File Name_L"); if rec_DocuUpload.FindFirst() then Variant_No := rec_DocuUpload.Document_No; Clear(Rec_MyDocumentAttachment); Rec_MyDocumentAttachment.Init(); Rec_MyDocumentAttachment.Validate("Table ID", 50029); Rec_MyDocumentAttachment.Validate("Document Type", rec."Document Type"::"Purchase Order"); Rec_MyDocumentAttachment.Validate("No.", Variant_No); Rec_MyDocumentAttachment.Validate("File Name", "File Name_L"); Rec_MyDocumentAttachment.Validate("File Extension", "File Extesion_L"); Rec_MyDocumentAttachment.Validate("File Size (KB)", "File Size (KB)_L"); Rec_MyDocumentAttachment.FileBlob.CreateOutStream(Outs); CopyStream(OutS, EntryInStream); Rec_MyDocumentAttachment.Insert(true); Commit(); end; DataCompression.CloseZipArchive; Window.Close; exit(ZipFileName); end;