I am throwing this question out there since I am stumped . I’ll try to explain the problem as closely as I can, but it can get rather long-winded I’m afraid, and I don't really think that there is a webspeed problem either to be honest, it just so happens that there is a problem that occures in a webspeed application.
We have an application that displays invoices to be attested by users. One part of the page is an iframe into which we stream the actual invoice image as a pdf using the following code:
INPUT STREAM inputfile FROM VALUE(ip_filefullpath) BINARY NO-ECHO.
LENGTH(vfileline) = 1024.
REPEAT:
IMPORT STREAM inputfile UNFORMATTED vfileline.
PUT {&WEBSTREAM} CONTROL vfileline.
PAUSE 1 NO-MESSAGE.
END.
INPUT STREAM inputfile CLOSE.
INPUT CLOSE.
LENGTH(vfileline) = 0.
The header for the page is done with the following:
run output-header-custom( input vShortName, input "application/pdf", input bAttachment, INPUT FILE-INFO:FILE-SIZE ).
procedure output-header-custom:
define input parameter ipcShortname as CHAR NO-UNDO.
define input parameter ipcContentType as CHAR NO-UNDO.
define input parameter ipbAttachment as LOGICAL NO-UNDO.
define input parameter ipiFilesize as INTEGER NO-UNDO.
if ipbAttachment then
output-http-header ("Content-disposition","Attachment; filename=" + ipcShortname).
output-http-header("Accept-Ranges":U,"bytes":U).
output-http-header ("Content-Length",STRING(ipiFilesize)).
OUTPUT-CONTENT-TYPE( ipcContentType ).
end procedure. /* output-header-custom */
We have been using this method of streaming our invoices for years. The application runs on servers administrated by our clients and this one client has just changed the server on which the application is run. After this change users have been reporting that they get an error when they try to scroll down in large pdf images. If the pdf is about four pages or more and they scroll down when it opens up the browser locks up and eventually an error message appears that a network problem has occurred while trying to open the file.
Now, I have seen this problem for myself while borrowing one of our users account and it appears that the pdf opens up in the browser before it has fully loaded. With the invoice I tried I saw the loading bar of Adobe Reader up to about 50kB of a 405kB file before it opened up in the browser. Then when I scrolled down IE9 locked up and I eventually got an error message. If I wait for the file to load fully in the background everything works perfectly (I get no indication that the page is loading or when the file is fully loaded using Windows 7 and IE9 however)
I grabbed the very same pdf that gave me the error and put it into my development environment and opened it up there. There it loaded the full 405kB file before it opened it up in the browser. I also tried to open up even larger files (up to 20000kB) and I could never get it to open up in the browser before it was fully loaded. So the image was the same, the client was the same (my Windows 7 computer using Adobe Reader X version 10.1.0 and IE9) and the application code was the same. But on one site the pdf opens up before it is loaded and on the other it does not.
I have played around with the settings in Adobe Reader where there were a few things that sounded like they could potentially have an effect on this problem, but no matter what settings I use in Adobe Reader I still get the same results. If there was a problem with my client or my settings it doesn't explain why it would behave differently for different sites either.
We have this application running on about 20 different sites with thousands of users and it is only on this one site that this exact problem ever occurs (for all users there though it would seem). It seems to me that the problem must be something with the server setup, but what about that could possibly affect how the userclient behaves? And if there is no problem with the server setup, then why would my client behave differently for different sites when everything else is the same? We are not responsible for the administration of the server, so I am unfortunately not able to check the setup there for myself. The administrator of the server pretty much just refers the problem to us however, so I guess I have to try tfind some sort of solution.
So, does anyone have any ideas about what could be causing these problems? Any ideas at all?
We have an application that displays invoices to be attested by users. One part of the page is an iframe into which we stream the actual invoice image as a pdf using the following code:
INPUT STREAM inputfile FROM VALUE(ip_filefullpath) BINARY NO-ECHO.
LENGTH(vfileline) = 1024.
REPEAT:
IMPORT STREAM inputfile UNFORMATTED vfileline.
PUT {&WEBSTREAM} CONTROL vfileline.
PAUSE 1 NO-MESSAGE.
END.
INPUT STREAM inputfile CLOSE.
INPUT CLOSE.
LENGTH(vfileline) = 0.
The header for the page is done with the following:
run output-header-custom( input vShortName, input "application/pdf", input bAttachment, INPUT FILE-INFO:FILE-SIZE ).
procedure output-header-custom:
define input parameter ipcShortname as CHAR NO-UNDO.
define input parameter ipcContentType as CHAR NO-UNDO.
define input parameter ipbAttachment as LOGICAL NO-UNDO.
define input parameter ipiFilesize as INTEGER NO-UNDO.
if ipbAttachment then
output-http-header ("Content-disposition","Attachment; filename=" + ipcShortname).
output-http-header("Accept-Ranges":U,"bytes":U).
output-http-header ("Content-Length",STRING(ipiFilesize)).
OUTPUT-CONTENT-TYPE( ipcContentType ).
end procedure. /* output-header-custom */
We have been using this method of streaming our invoices for years. The application runs on servers administrated by our clients and this one client has just changed the server on which the application is run. After this change users have been reporting that they get an error when they try to scroll down in large pdf images. If the pdf is about four pages or more and they scroll down when it opens up the browser locks up and eventually an error message appears that a network problem has occurred while trying to open the file.
Now, I have seen this problem for myself while borrowing one of our users account and it appears that the pdf opens up in the browser before it has fully loaded. With the invoice I tried I saw the loading bar of Adobe Reader up to about 50kB of a 405kB file before it opened up in the browser. Then when I scrolled down IE9 locked up and I eventually got an error message. If I wait for the file to load fully in the background everything works perfectly (I get no indication that the page is loading or when the file is fully loaded using Windows 7 and IE9 however)
I grabbed the very same pdf that gave me the error and put it into my development environment and opened it up there. There it loaded the full 405kB file before it opened it up in the browser. I also tried to open up even larger files (up to 20000kB) and I could never get it to open up in the browser before it was fully loaded. So the image was the same, the client was the same (my Windows 7 computer using Adobe Reader X version 10.1.0 and IE9) and the application code was the same. But on one site the pdf opens up before it is loaded and on the other it does not.
I have played around with the settings in Adobe Reader where there were a few things that sounded like they could potentially have an effect on this problem, but no matter what settings I use in Adobe Reader I still get the same results. If there was a problem with my client or my settings it doesn't explain why it would behave differently for different sites either.
We have this application running on about 20 different sites with thousands of users and it is only on this one site that this exact problem ever occurs (for all users there though it would seem). It seems to me that the problem must be something with the server setup, but what about that could possibly affect how the userclient behaves? And if there is no problem with the server setup, then why would my client behave differently for different sites when everything else is the same? We are not responsible for the administration of the server, so I am unfortunately not able to check the setup there for myself. The administrator of the server pretty much just refers the problem to us however, so I guess I have to try tfind some sort of solution.
So, does anyone have any ideas about what could be causing these problems? Any ideas at all?