Find Jobs
Hire Freelancers

php cURL options help

$10-30 USD

Completed
Posted over 8 years ago

$10-30 USD

Paid on delivery
I need print output of this function to user, but sometimes I get .pdf files and I not need print .pdf I put a filter in $strURL for not process the URL if end in .pdf but sometimes I need processing URLs that redirect to .pdf files (ex: [login to view URL]) and I can't put CURLOPT_FOLLOWLOCATION to 0 function sGetBuffer( $strURL, $strREFERER ) { if(substr( $strURL, -4) == '.pdf')) return; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $strURL); curl_setopt($ch, CURLOPT_REFERER, $strREFERER); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: en-us,en;q=0.5")); $output = curl_exec($ch); curl_close($ch); return $output; } Exists an option for filter format files in php for cURL ? Thanks in advanced.
Project ID: 8415434

About the project

2 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I would also check the response after the request to see if the file is a pdf. First I would check the content type then the actual content of the file.
$25 USD in 1 day
5.0 (11 reviews)
2.6
2.6
2 freelancers are bidding on average $30 USD for this job
User Avatar
Hello, My name is Joshua and I would like to assist you with this project. I have extensive hosting experience and can get started quickly. thanks,
$35 USD in 1 day
4.9 (42 reviews)
4.7
4.7

About the client

Flag of CHILE
concon, Chile
5.0
69
Payment method verified
Member since Jul 14, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.