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 4103738
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:59:49+00:00 2026-05-20T20:59:49+00:00

I am using the following code but there appears to be warning with fseek

  • 0

I am using the following code but there appears to be warning with fseek and returns -1 instead of 0.

$file = fopen("http://www.example.com/public_html/data/video/temp.mov", "r") or exit("unable to open file");
fseek($file, -128, SEEK_END);

The file gets opened definately but fseek doesn’t work. Is there some other method to read video from server?

Following is the error message

Warning: filesize() [function.filesize]: stat failed for 

Warning: fseek() [function.fseek]: stream does not support seeking in 
  • 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-05-20T20:59:50+00:00Added an answer on May 20, 2026 at 8:59 pm

    It must be some platform dependant problem. Try this code:

    $filename = "www.example.com/public_html/data/video/temp.mov";
    $file = fopen ($filename, "r")
        or exit("unable to open file");
    fseek ($file, filesize ($filename) - 128);
    

    HTTP wrapper does not support seeking. If you want to seek in a remote file thru HTTP you need to get the size of the file. One possible way is to interpret a directory listing, or make a HEAD request. When you know the filesize you can use curl and Range like here.

    This is also a method to get remote file size.

    How to download a file with cURL (This example loads the data into a PHP variable, use only if you want to process the data, If you just want to save it into an external file use CURLOPT_FILE instead of CURLOPT_RETURNTRANSFER):

    $c = curl_init (); 
    curl_setopt ($c, CURLOPT_URL, "http://example.com/some_dir/some_file.ext"); 
    curl_setopt ($c, CURLOPT_RANGE, max (0, $filesize - 128) . '-' . max (0, $filesize - 1));
    curl_setopt ($c, CURLOPT_RETURNTRANSFER, true);
    $content = curl_exec ();
    echo ($content);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code illustrates an object literal being assigned, but with no semicolon afterwards:
I'm using the following code to get the members of a group on my
I'm trying to present a UIImagePickerController from a UITableViewController subclass using the following code:
In VC++ 2003, I could just save the source file as UTF-8 and all
I'm having a problem with some code that used to work in PHP 4.X
I'm trying to search an LDAP database using the ODQuery method. I have the
I am using WMI to detect a number of items about a network adapter's
We are trying to split up our monolithic EXE into a combination of an
I'm maintaining an ASP.NET site where users can log on to register some set
In a Grails 1.1 plugin, I'm trying to load a class from the main

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.