I am displaying architectural drawings in the browser except for larger files which are downloaded to the user’s hard drive with the following code…
Dim f As FolderItem = Volume(0)
f = New FolderItem(SelectedDrawingDocPath, folderitem.PathTypeNative)
myPDFFile = WebFile.Open(f)
myPDFFile.MIMEType = "application/pdf"
myPDFFile.ForceDownload = True
There are some really big files and somewhere over 500mb WebFile.Open chokes with an out of memory error. When this happens, Xojo stops responding and needs to be closed and restarted on the server. Sometimes Xojo throws the error, sometimes the borwser throws an error and Xojo stops responding, sometimes xojo actually delivers the document but stops responding. My development machine has 32gb of RAM and I am getting out of memory errors somewhere around 750mb.
I am working around the problem by uploading the really large drawings to AWS S3 and sending an email to the end user with a link to download the file. That’s fine, but would prefer to use Xojo. Is there any way to avoid running out of memory with the above code. Is there another way to download documents to the users hard disk that would not encounter this problem?