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

Posts: 22,226
Location: Blackpool. UK
Trades: 0
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!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
 
When You Register, These Ads Go Away!
Old 11-29-2007, 08:32 PM Re: How can I add file size limitations?
Extreme Talker

Posts: 182
Trades: 0
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, 08:52 PM Re: How can I add file size limitations?
chrishirst's Avatar
Super Moderator

Posts: 22,226
Location: Blackpool. UK
Trades: 0
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!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-29-2007, 10:15 PM Re: How can I add file size limitations?
Extreme Talker

Posts: 182
Trades: 0
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, 09:36 PM Re: How can I add file size limitations?
chrishirst's Avatar
Super Moderator

Posts: 22,226
Location: Blackpool. UK
Trades: 0
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!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How can I add file size limitations?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.11998 seconds with 12 queries