Connecting Tech Pros Worldwide Help | Site Map

image upload and page refresh

Gary \(Girish\)
Guest
 
Posts: n/a
#1: Jul 19 '05
Hello:
I am using SA-FileUp to enable members to upload their product
images
to my ISP sever. When member uploaded a new image file, the file name is
replaced with the member ID and the old file is then overwrited.

Here is the problem:
Member can uploaded new image at "Upload page" BEFORE viewing the new
image at the "Detail page" without any problem. However, when member 1st
viewed the image at the "Detail page" and then upload the new image at the
"Upload page", the whole page is blocked more than 1 minute and the browser
will only load the old image unless manually he/she has to manually reload
(netscape) or refresh (IE) the browser.

It should not be the bandwidth problem because I can upload diff image
(with any size) as long as I don't load the old image from the browser
BEFORE
upload the new image to the server. I think the problem is caused by
caching.
I already put expires=0 on both "Display" and "Upload" page but the problem
still exist.

<% Response.Expires=0 %>
<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</head>

vin=request("vin")
'response.write(vin)

Set upl = Server.CreateObject("SoftArtisans.FileUp")
upl.SaveAs "i:\pp\temp\" + session("rand_id") + ".jpg"
Set objImageGen = Server.CreateObject("softartisans.ImageGen")

response.write("i:\pp\temp\" + session("rand_id") + ".jpg")

objImageGen.LoadImage "I:\pp\temp\" + session("rand_id") + ".jpg"
' Check width of image
img_width=objImageGen.Width
if (img_width>500) then
objImageGen.CreateThumbnail 500,0,2
end if
'Save main image to i:/pp/carmart/photos
objImageGen.SaveImage 0, 3, "i:\pp\carmart\photos\" + vin + "-1.jpg"

'Save thumbnail to i:/pp/carmart/thumbs
objImageGen.CreateThumbnail 101,0,2
objImageGen.SaveImage 0, 3, "i:\pp\carmart\thumbs\" + vin + "-1t.jpg"
session("rand_id")=""


Aaron Bertrand - MVP
Guest
 
Posts: n/a
#2: Jul 19 '05

re: image upload and page refresh


> <% Response.Expires=0 %>

This is not enough.
http://www.aspfaq.com/2022

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


Garyrek
Guest
 
Posts: n/a
#3: Jul 19 '05

re: image upload and page refresh


I tried
<%
pStr = "private, no-cache, must-revalidate"
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", pStr
%>

didn't work, tried cache isapi thing as well, I have buffer turned on IIS so
tried setting it to false as well still no luck
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:uOfTixbOEHA.620@TK2MSFTNGP10.phx.gbl...[color=blue][color=green]
> > <% Response.Expires=0 %>[/color]
>
> This is not enough.
> http://www.aspfaq.com/2022
>
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>[/color]


Closed Thread