Hi,
We have created sample application for cloudfront signed URL file Size: 40.9kb, 13mb, 21.1mb to view the web viewer is working in all browsers, but the file size 203.6mb is not working in all browsers.
I’m working in a C# 4.0 web application project and below is the code snippet that I’m using that is failing.
public void ProcessRequest(HttpContext context)
{
string MethoodName = context.Request.QueryString["MethodName"].ToString();
string FileName = context.Request.QueryString["val"].ToString();
switch (FileName)
{
case "1":
break;
case "2":
break;
case "3":
break;
case "4":
break;
default:
break;
}
if (MethoodName == "BytesURL")
{
try
{
System.Net.WebRequest wreq = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(FileName);
using (System.Net.HttpWebResponse wresp = (System.Net.HttpWebResponse)wreq.GetResponse())
using (System.IO.Stream mystream = wresp.GetResponseStream())
{
using (System.IO.BinaryReader reader = new System.IO.BinaryReader(mystream))
{
int length = Convert.ToInt32(wresp.ContentLength);
context.Response.Clear();
context.Response.Buffer = false;
context.Response.BufferOutput = false;
context.Response.ContentType = "application/vnd.ms-xpsdocument";
context.Response.AddHeader("Content-Length", length.ToString());
byte[] buffer = ReadFully(mystream);
if (context.Response.IsClientConnected)
{
context.Response.OutputStream.Write(buffer, 0, buffer.Length);
context.Response.OutputStream.Flush();
}
}
}
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
catch (Exception ex)
{
}
}
}
public byte[] ReadFully(System.IO.Stream input)
{
byte[] buffer = new byte[4 * 1024];
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
int read;
ms.Flush();
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
{
ms.Write(buffer, 0, read);
}
return ms.ToArray();
}
}
The error message I get is as follows.
Firefox: Loading long time.
Chrome: script crashes.
IE: Not loading
System Configuration,
Windows 7 64 bit
Browsers: Firefox 32, IE 11, Chrome 37.0.2062.120
Can you please look at the 204mb URL and reply why the big size URL are not launched in the pdftron web viewer ASAP
Looking forward to your reply.
<w:LsdException Locke...
<w:LsdException Locke...
...
new PDFTron.WebViewer({
...
streaming: false
}