Uploading attachments in Bulk - Limitation

mysamza
Member Posts: 66
Brief;
I am uploading files in bulk to our custom table's headers and I am getting the following error;
Specs;
Business Central (SaaS)
Version: W1 18.4 (Platform 18.0.28593.30086 + Application 18.4.28601.29160)
Details;
I have created Header, Lines, and a table to store attachments.
a)Manufacturing Job Header
b)Manufacturing Job Lines
c)Manufacturing Attachments
I have Header and Lines data uploaded and now I have to upload attachments.
Taking hints from the logic written on Inventory Setup's -> Import Item Pictures
I wrote the following code;
I am uploading files in bulk to our custom table's headers and I am getting the following error;
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.
Specs;
Business Central (SaaS)
Version: W1 18.4 (Platform 18.0.28593.30086 + Application 18.4.28601.29160)
Details;
I have created Header, Lines, and a table to store attachments.
a)Manufacturing Job Header
b)Manufacturing Job Lines
c)Manufacturing Attachments
I have Header and Lines data uploaded and now I have to upload attachments.
Taking hints from the logic written on Inventory Setup's -> Import Item Pictures
I wrote the following code;
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;
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions