Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Downloading PDF from server

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Downloading PDF from server

Postby Si14 » Tue Mar 26, 2013 7:47 pm

Hello all,

I need a simple PHP code to download all the PDF files in "www.exampleurl.com".

Thank you for your time.
Si14
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Mar 26, 2013 7:43 pm

Re: Downloading PDF from server

Postby chrisranjana.com » Tue Mar 26, 2013 9:04 pm

chrisranjana.com
New php-forum User
New php-forum User
 
Posts: 8
Joined: Sat Dec 07, 2002 6:47 pm
Location: Chennai , Tamil Nadu , India

Re: Downloading PDF from server

Postby Si14 » Tue Mar 26, 2013 11:14 pm

Thank you for your reply. However, the link you sent is not what I am looking for.
I need a code to download all PDF files of a URL.
I will be running this code on my localhost (WAMP).
Thank You.
Si14
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Mar 26, 2013 7:43 pm

Re: Downloading PDF from server

Postby seandisanti » Thu Mar 28, 2013 10:37 am

Is the url going to contain a list of pdf's?
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Downloading PDF from server

Postby Si14 » Thu Mar 28, 2013 10:49 am

Yes, I have several URLs, and each of them contains several PDFs. I want to download all PDFs of each URLs into a separate folder.
Si14
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Mar 26, 2013 7:43 pm

Re: Downloading PDF from server

Postby seandisanti » Thu Mar 28, 2013 10:05 pm

probably the easiest would be to use simplehtmldom (http://simplehtmldom.sourceforge.net/) to parse the links from the pages, and then use your favorite string methods to identify which are pdf links, and then download them that way. There are still several more ways you can actually save the files based on the parsed urls of their file locations. I will need to see some of your code to offer any more specific help.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.