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

  • Home
  • SEARCH
  • 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 77867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:53:51+00:00 2026-05-10T20:53:51+00:00

It seems if I do something like $file = fopen($filepath, w); $CR = curl_init();

  • 0

It seems if I do something like

$file = fopen($filepath, 'w'); $CR = curl_init(); curl_setopt($CR, CURLOPT_URL, $source_path); curl_setopt($CR, CURLOPT_POST, 1); curl_setopt($CR, CURLOPT_FAILONERROR, true); curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1); curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($CR, CURLOPT_FILE, $file); $result = curl_exec( $CR ); $error = curl_error( $CR ); print filesize($filepath); 

I get a different result than if I just run

print filesize($filepath); 

a second time. My guess is that curl is still downloading when do a filesize().

  • 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. 2026-05-10T20:53:52+00:00Added an answer on May 10, 2026 at 8:53 pm

    Note that functions like filesize() cache their result, try adding a call to clearstatcache() above ‘print filesize(…);’. Here is an example:

    $file = '/tmp/test12345'; file_put_contents($file, 'hello'); echo filesize($file), '\n'; file_put_contents($file, 'hello world, this is a test'); echo filesize($file), '\n'; clearstatcache(); echo filesize($file), '\n'; 

    See http://www.php.net/clearstatcache

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any intrinsic support for namespacing in coffeescript? Adequate namespacing seems like something
It seems to be possible in Java to write something like this: private enum
I could do it with regex (something like myString.match(/^[A-Za-z0-9]$/) ) but it seems like
I am looking to write something that seems like it should be easy enough,
This seems like it should be something I already know. We need to run
This seems like it should be something very easy to do, but every time
I feel like I am missing something - from what it seems, JSP comes
Hi this seems like it should work, from something in collectionofsomestuff select new SelectListItem(){Text
cgi.escape seems like one possible choice. Does it work well? Is there something that
I have a file called something like FILE-1.txt or FILE-340.txt. I want to be

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.