Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 20th, 2005, 04:33 AM
Registered User
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Downloading by modifying headers

hi,
i want to download a html file which is in the server ,There is a link in the page so that clicking that link save as dialog will appear and i am able to save that html file to the client side,this i had done by mdifying header information.My problem is that i have an image in that page ,this image is not downloaded with that html page ,so when i open the saved image from client image space is blank.if we save the file using browser's file menu "SaveAs" then image will be downloaded with that html page(i don't want to use this method).Can anyone help me solve this problem ..............


Jerry

 
Old May 21st, 2005, 01:15 AM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

Take a look at the php header() function.

What you're looking for is:

header("Content-type: image/png");

Options are: image/png, image/giff, image/jpeg

(You might want to check all this - it's just off the top of my head)

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com
My blog: http://colinhorne.blogspot.com
 
Old May 21st, 2005, 02:02 AM
Registered User
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i had worked with these options earlier

header("Content-type: image/png");

This will help in downloading images ,but i need to save the html page with all images in seperate folder as we get ,when we use SaveAs option in the browsers menu File-SaveAs.

if i am able to download mulitple files in one download ,with out zipping them,then i am done ,is this possble.



 
Old May 21st, 2005, 02:18 AM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

Not quite sure if I understand what you want.

You want to make it so people can download - and save - the full contents of your web page in one go, images and all?

If so, then that's not really possible without zipping the directory.

You can, however, use tools to downlaod all the images in a webpage. Normally if you click "File -> Save Page As" in your web browser, you can save the whole page. Also, take a look at wget.

Cheers

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com
My blog: http://colinhorne.blogspot.com
 
Old May 23rd, 2005, 01:28 AM
Registered User
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ya exactly you are correct

I want to make it so people can download - and save - the full contents of my web page in one go, images and all

After searching i also reached in the same conclusion that we are not able to download multiple files with out ziping


jerry







Similar Threads
Thread Thread Starter Forum Replies Last Post
modifying Webshop mlevans BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 September 23rd, 2006 05:12 AM
WHat is "http headers"? gilgalbiblewheel Classic ASP Databases 1 September 14th, 2005 11:59 AM
Help With PHP Headers!! majingohan Beginning PHP 1 April 17th, 2005 04:16 AM
Modifying XML enderjs XML 0 October 7th, 2004 10:29 AM
Headers skicrud Beginning PHP 2 October 10th, 2003 02:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.