Downloading PDF from server

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Si14
New php-forum User
New php-forum User
Posts: 3
Joined: Tue Mar 26, 2013 7:43 pm

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.

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
Contact:

Re: Downloading PDF from server

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


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 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.

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 seandisanti » Thu Mar 28, 2013 10:37 am

Is the url going to contain a list of pdf's?

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 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.

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 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.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests