dmaksimov Posted May 16, 2011 Share Posted May 16, 2011 Hello everyone. I have a script which opens a remote file, downloads it into a buffer and then sends it out to the user. At the moment, I'm using fopen() to retrieve the remote file. Everything works correctly, except when the user requests a range of the file. To do this, I tried fseek() but the problem is that fseek() does not work with remote files and gives me an error. Is there any other way I can go about doing this? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/236519-fseek-on-remote-file/ Share on other sites More sharing options...
requinix Posted May 16, 2011 Share Posted May 16, 2011 Send an Accept-Ranges header with your request. If that fails then you'll have to request the entire file all over again, read past the parts you don't want, and pass the parts you do want through to the client. Quote Link to comment https://forums.phpfreaks.com/topic/236519-fseek-on-remote-file/#findComment-1215946 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.