2021年4月10日星期六

Is there a way to stream a remote file as "zipped" without downloading to server?

Look at this simple code

<?php  readfile('http://ovh.net/files/1Mio.dat');  ?>  

This code together with the link are examples.

My server is working as if it were a kind of proxy. Displaying a remote raw file for the user.

I cannot download the file to my server because it is too big. I can't save to the server, I can't do anything with the file itself.

I need and searched the internet all about file formats (zip, rar, tar, gzip etc) that had the raw code of the archiver as simple as I could display to the user something like.

echo "#filename,filesize";  readfile ($url1);  echo "#filename1,filesize1";  readfile ($url2);  

So user gets a raw file like this

#file1.dat,12312  (rawdata of file)  #file2.dat,1232  (rawdata of file)  

And the final file, it would be like a zip file containing these 2 files

I tried a lot however I didn't get any satisfactory answer.

All the answers I find are necessary to download the file on the server.

It also doesn't really have to be zip, any other usable format. One option would be to simply display all of the entire files and leave it to the user to split it up into pieces with some file splitter, but that is not a friendly thing either.

@edit cant load into memory aswell

https://stackoverflow.com/questions/66958782/is-there-a-way-to-stream-a-remote-file-as-zipped-without-downloading-to-server April 06, 2021 at 03:35AM

没有评论:

发表评论