WebRequest.File not returning whole document via SSL

I have started using Request.File to return PDF files via HandleSpecialURL (See my previous post )

This works fine but when I try to run my webservice via SSL, only part of the document is downloaded. The PDF viewer then tells me that the PDF is not viewable. This only happens if the file is large. Small files are downloaded fine.

Do I need to set any Headers or other parameters to make the Request.File method work over SSL?

Thanks

You shouldn’t. Have you tried just downloading the PDF to your computer to see what’s actually wrong with it?

There’s nothing wrong with the PDF. I can open the file and view it correctly on the server. I can download it fine using HTTP. If I try to download it using HTTPS, it only downloads the first chunk.

Here are some links to a test application running on our server to try:
Non SSL Version
SSL Version

The PDF is 6,556KB and downloads fine using the Non SSL Version
If you try the SSL version, only 1608KB is downloaded.

Here is the code in HandleSpecialURL:

Dim ThisFile As FolderItem = GetFolderItem("C:\\Wasp Test Apps\\LibraryDataNode\\test.pdf")

Request.File = ThisFile

Return True

[quote=426217:@Jim Brock]Here are some links to a test application running on our server to try:
Non SSL Version
SSL Version

The PDF is 6,556KB and downloads fine using the Non SSL Version
If you try the SSL version, only 1608KB is downloaded.

Here is the code in HandleSpecialURL:

[code]
Dim ThisFile As FolderItem = GetFolderItem(“C:\Wasp Test Apps\LibraryDataNode\test.pdf”)

Request.File = ThisFile

Return True
[/code][/quote]
Yeah, that’s definitely a disconnect. I’m curious… could the app be crashing?

@Greg O’Lone I don’t believe so. Both the SSL and Non-SSL versions are running on the same instance of the application. The application is still up and running and accepting connections.

The links above are a test app with just those 3 lines of code in the HandleSpecialURL. Our real world application behaves in exactly the same way on our clients servers.

I’ve just added some code to the UnhandledException event to print a message to the console if an error has occurred but no error is showing.

What version of Xojo is this?

@Greg O’Lone 2018 R4

I’ve added this as a case:

<https://xojo.com/issue/55039>

@Greg O’Lone Sorry to hassle Greg but can you confirm whether this is a Xojo issue or is there anything I can do to fix this? I’m getting hassled by my customers and I don’t know what the score is. Thanks

Could you try something else for me?

Does a large image behave the same way? Or a text file?

Just tested with a large PNG. It does the same thing. You can try from our server:

Non SSL Version
SSL Version

[quote=426539:@Jim Brock]Just tested with a large PNG. It does the same thing. You can try from our server:

Non SSL Version
SSL Version[/quote]
Neither of those work.

Apologies. I was playing with the port numbers. Back up now.

@Greg O’Lone

Have a look at this artice:
HTTPS downloads failingRSS

I’m not sure how you access HTTP ports so not sure if it’s relevant. However, the symptoms are exactly the same as we are experiencing.

This article is discussing the MinBytesPerSecond HTTP parameter with the Windows APIs. Is this relevant to how you are accessing the HTTP ports?

I’ve checked our HTTP logs and we are not seeing the “Timer_MinBytesPerSecond” error they mention. We also don’t have the "MinBytesPerSecond " registry setting.

Thanks

That article is talking about a bug in the http/2.0 implementation on IIS. We don’t use IIS for the web server and the current web framework doesn’t support http/2.0, so I can’t see how that info is relevant unless you’re using IIS as a reverse proxy in front of your app.

I would appear to be having a similar issue on 2019-r1.1 standalone web. I have a file that I want the user to download, I use this code in the HandleSpecialURL event handler.

Request.File = f
Request.Status = 200
Return True

It seems to connect and start the download but only grabs the first 200kB to 500kB (in this case 319,573B, every time) using chrome.

Headers show the length of the file is correct:

Connection: close Content-Description: File Transfer Content-Disposition: attachment; filename="***.***" Content-Encoding: gzip Content-Length: 32521391 Content-Type: application/octet-stream

I am using LetsEncrypt to provide an SSL cert, Ubuntu 16.04 Server, Chrome on macOS to download the file.

Anyone else seen this behavior?