Page 1 of 1

Attachment Sizes

Posted: Wed Aug 15, 2018 3:10 pm
by mlevi
I had a few question with regards to attachments.

1) Does SoftPro shrink attachment files after they are uploaded, if they are very large. If yes, do they always shrink the files or only if they are larger then a specific size amount.
2) Is there a recommended file size limit for uploading attachments.

Thanks in advance.

Re: Attachment Sizes

Posted: Wed Aug 15, 2018 3:40 pm
by mhoutz
Hello,

To answer your questions:

1. Yes, they are zipped regardless of how large they are.
2. Officially, there is no recommended size limit at all. I have tested up to 30 mb attachments with no issues, but there could be some issues in publishing documents larger than 30mb.

Let me know if you have further questions.

Mike

Re: Attachment Sizes

Posted: Tue Sep 10, 2019 8:30 am
by toddsou
Hi-

I'm running into issues attaching files that are ~50MB. Specifically, the API call throws an OutOfMemory exception. I am running Select 4.3.10.6.

I checked the error logs on the App Tiers to see if it came from there, but it did not.

My client has ~8GB of RAM and at the time of the exception, PerfMon reported ~85% of memory was in use. I closed the order, but left Select open, and PerfMon reported no change in available memory.

Here's the code that my shell package is attempting to use. The byte[] is already in memory when this method is called. The exception is thrown within here. Please advise.... :

Code: Select all

        
        public void AddAttachmentToSpsOrder(IAttachmentFolder attachmentFolder, UploadedDocumentModel model, byte[] attachmentContent)
        {
            attachmentFolder.NewFile(Path.GetFileNameWithoutExtension(model.DisplayName), new MemoryStream(attachmentContent), Path.GetExtension(model.DisplayName));
        }
Thanks

Re: Attachment Sizes

Posted: Tue Sep 17, 2019 10:15 am
by mhoutz
Hi-

You may be having memory issues due to the environment. I was able to upload attachments of around 100 with a shell package on my machine, but then again, I have 32 mb of RAM which may help do that.

Can you use the code below and see if this works for you? Note I used an attachment on my drive. This will be just a test to see if you can load the same attachment from the client drive itself, and see if it's the memory stream that is giving you trouble. You also may want to try more than one attachment over 50mb, just to make sure.

string pdfFilePath = "C:\\Temp\\Your_Attachment_Name.pdf";
byte[] attachmentContent = System.IO.File.ReadAllBytes(pdfFilePath);

folderItem.NewFile("Your_Attachment_Name", new MemoryStream(attachmentContent), "pdf");
os.ApplyChanges(o);

os.CloseOrder(newOrder);

Mike