How do I fix this script to upload this zip file to the server

How do I fix this PHP script to upload a zip file to the server?  I am getting an error on the "write".  

Parse error: syntax error, unexpected 'w' (T_STRING)


$rebateurl = "";

// save that image to our server!
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $rebateurl);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
$new_filename = "";

$f = fopen('$new_filename, 'w');   //ERROR HERE
fwrite($f, $image);


Open in new window

Thanks for your help!
Who is Participating?
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
You had an extra single quote.
$f = fopen($new_filename, 'w');   //ERROR HERE

Open in new window

lawrence_devAuthor Commented:
THANK YOU DAVE!  I looked and looked and could not find it!!  Thanks for the help!!
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  That's one my most common errors cause it looked right when I typed it!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.