Attachment Sizes

Discussions related to custom development with Select.
Post Reply
mlevi
Posts: 53
Joined: Mon Dec 01, 2014 2:33 pm

Attachment Sizes

Post 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.
mhoutz
Posts: 14
Joined: Wed Dec 14, 2016 5:22 pm

Re: Attachment Sizes

Post 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
toddsou
Posts: 75
Joined: Wed Jul 25, 2012 9:39 am

Re: Attachment Sizes

Post 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
mhoutz
Posts: 14
Joined: Wed Dec 14, 2016 5:22 pm

Re: Attachment Sizes

Post 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
Post Reply