473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Display Large Images

I am trying to upload large images ( around 4 mb) from the server to show on
the client. Currently I'm using an http handler to do it and breaking it
into chunks sending it 1 mb at a time. Sometimes I'm getting errors, like
the page won't load. Any solutions on how this is done right? Thanks for
your help.
Jul 26 '06 #1
2 1579
cnote wrote:
I am trying to upload large images ( around 4 mb) from the server to
show on the client. Currently I'm using an http handler to do it and
breaking it into chunks sending it 1 mb at a time. Sometimes I'm
getting errors, like the page won't load. Any solutions on how this
is done right? Thanks for your help.
"http handler"?
Is this a classic asp or asp.net question?
If the latter:
There was no way for you to know it (except maybe by browsing through some
of the previous questions before posting yours - always a recommended
practice) , but this is a classic asp newsgroup. ASP.Net bears very little
resemblance to classic ASP so,
while you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 26 '06 #2
This worked for me (I was running into the 4MB ceiling too) (Thanks to
Jason Withrow's contribution to ASP101
which helped me get started on downloading files)

Response.Buffer = True 'I didn't try "False"
Const BufSize = 2097152 '2MB "chunk"
Dim i
Dim objstream
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
strFileType = lcase(Right(strFileName, 4))

' Feel Free to Add Your Own Content-Types Here
Select Case strFileType
Case ".doc"
ContentType = "application/msword"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
:
: 'other cases
:
Case Else
ContentType = "application/octet-stream"

End Select
Response.Charset = "UTF-8"
Response.ContentType = ContentType
i = 1
Response.BinaryWrite objStream.Read(BufSize)

Response.Flush
while not objstream.EOS
objstream.Position = (BufSize * i)
Response.BinaryWrite objstream.Read(BufSize)
Response.flush
i = i + 1
wend
objStream.Close
Set objStream = Nothing


"cnote" <cn***@discussions.microsoft.comwrote in message
news:B1**********************************@microsof t.com...
>I am trying to upload large images ( around 4 mb) from the server to show
on
the client. Currently I'm using an http handler to do it and breaking it
into chunks sending it 1 mb at a time. Sometimes I'm getting errors, like
the page won't load. Any solutions on how this is done right? Thanks for
your help.


Aug 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to...
3
by: Dafna m | last post by:
Please HELP 1. How can I display an array of images from diffrent types(jpeg, bmp..)(In C#) Can I also display video files?(In C#) *** Sent via Developersdex http://www.developersdex.com...
3
by: Celine | last post by:
Hi everyone! I am building a website in asp.net using c# where I need to be able to upload 100 images to the server at a time. As I am new to asp.net, I was wondering if there was an easy way to...
4
by: drew197 | last post by:
I am a newbie. I am editing someone elses code to make it compatible with Firefox and Safari. In IE, when you click on the proper link, a block of text is shown in a nice paragraph form. But, in...
18
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want...
3
by: kansaschuck | last post by:
Ok... Let me start over since I had miss labeled the other question and it ended up in phpland and I failed to follow the posting rules. Sorry, here's a rework. (hey... I just saw the html code...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
8
by: theCancerus | last post by:
Hi All, I am not sure if this is the right place to ask this question but i am very sure you may have faced this problem, i have already found some post related to this but not the answer i am...
1
by: swethak | last post by:
Hi, I write the code to display images.But it will not display image.And also gives the error like that error : Notice: Undefined index: gim in F:\Facebook\pic_up.php on line 59 plz tell...
22
Atli
by: Atli | last post by:
Hi. I'm setting up a small photo-album-type thing, where I use PHP to set up a list of images for visitors to click through. That's all simple enough. However, I'm having a weird bug in IE8. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.