Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9071379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:53:47+00:00 2026-06-16T17:53:47+00:00

I know my question is quite similar to this question and I’m using the

  • 0

I know my question is quite similar to this question and I’m using the answer to the problem as my solution but I can’t get it to work.

I’m using Immediatenet.com to generate a thumbnail of any given URL (example: google). And then using cURL to save the image in a folder on my server.

I’m not sure if the problem lies in the fact that the URL isn’t actually an image URL (ie example.com/image.jpg) or a .html/.php URL or that I’m simply not doing it right. I’ve never used cURL before so it’s distinctly possible that I’m not doing it right.

I’m saving the path to the image into a MySQL database which works just fine. However, the image doesn’t actually save in the folder specified. The permissions are set correctly on the folder, so I don’t think it’s a permissions problem. I also set allow_url_fopen to On just to make sure.

My code is below. Can anyone point me in the right direction for this one?

$url = $_POST['url'];
$url_new = 'http://immediatenet.com/t/m?Size=1024x768&URL='.$url;
$img = "/users/images/".$url.".jpg";
$ch = curl_init($url_new);
$fp = fopen($img, 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);
fclose($fp);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:53:48+00:00Added an answer on June 16, 2026 at 5:53 pm

    If $url contains forward slashes (as most URLs do), these will be treated as directory delimiters in the $img pathname. You either need to replace the slashes with some other character, or create all the necessary directories.

    $img = "/users/images/".str_replace('/', '_', $url).".jpg";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is quite similar question to one older but the solution did not work
I know this question has been asked several times, but I can't quite seem
I know this question is quite basic but I am new to JQuery and
I know this question might sound quite silly, but I somehow found myself stuck
I know this question has been rised quite a lot of times, but then
I know this is quite a ridiculous question but this is quite confusing and
I know there are a LOT of similar question to this, but I've tried
I know there is this question that is very similar, but I wanted to
Despite other similar examples, I cannot quite get this each loop to work to
I know this very similar question has been asked before quite a few times

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.