Reply
How can I add file size limitations?
Old 11-29-2007, 01:25 PM Re: How can I add file size limitations?
chrishirst's Avatar
Super Moderator

Posts: 11,865
Location: Blackpool. UK
although as the response.write will never be seen

Code:
else
    SaveFiles()
' the redirect would go here 
end if
Would do the same and save a few CPU clock cycles
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-29-2007, 07:32 PM Re: How can I add file size limitations?
Super Talker

Posts: 116
Thank you for your two replies.

I don't understand what you mean in the second one when you say "although as the response.write will never be seen" and "Would do the same and save a few CPU clock cycles". Can you educate me?

Thanks again.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 11-29-2007, 07:52 PM Re: How can I add file size limitations?
chrishirst's Avatar
Super Moderator

Posts: 11,865
Location: Blackpool. UK
because of the speed of a server side redirect the response.write savefiles() would finish buffering the data and then the redirect would occur.
The buffered data would never be sent to the client browser.

So as the SaveFiles routine does no client output, it can be called and then redirected.
The server resources and CPU time taken to buffer the output would not be needed. It would make a very limited difference to the server overheads but every little helps as they say.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-29-2007, 09:15 PM Re: How can I add file size limitations?
Super Talker

Posts: 116
thanks for your reply.
It's a little bit clearer to me, but I'm not sure which re-direct code reply you recommend.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 11-30-2007, 08:36 PM Re: How can I add file size limitations?
chrishirst's Avatar
Super Moderator

Posts: 11,865
Location: Blackpool. UK
it all depends;

If you want to ensure the post data is lost in the redirect (so no warning messages on refresh) you would need to use a 301/302/307 redirect.

Code:
<%
'response.status = "301 Moved Permanently"
'response.status = "302 Found"
response.status = "307 Object Moved"

' set the type of redirect required

response.addheader "Location", "landing_page.asp"
response.end
%>
uncomment the one you want to use.


or a transfer could be used.

Code:
server.transfer("landing_page.asp")
This would transfer processing to the destination page and the variables and form data would be intact so if needs be you could print out results on the landing page.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How can I add file size limitations?

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14135 seconds with 12 queries