Hey Guys, u I am using mogilefs to store files on a storage cluster. And i want to offer a download link to users. Only when i run getPaths on mogileFS it returns something like:
http:开发者_如何学Python//10.0.0.23:7500/dev11/0/422/711/0494715033.fid
i can rename the .fid to the actual file extension, but how do i offer the original file for download to the user? Can i force the file somehow with php? (Without using readfile or anything, the files are there for bandwidth reasons).
thnx guys
Here you are http://www.grid.net.ru/nginx/mogilefs.ru.html
How it works:
all requests with /storage/mogileKey are served from mogile storage with nginx webserver
all other request you can easily proxy to your apache listening :not80port (:88 for example)
while stoaring file to mogilefs give it a key with required extension: myimage.jpg ...
When your request will look like normal: /storage/myimaje.jpg and will served from /devN/path/to/mogile/file.fid
How does that URL respond? If it is HTTP, than no problem, it will set the mime-type, although you have to set Content-Disposition... If it's not HTTP, than you have to make a wrapper which responds HTTP to the HTTP request.
You should first try: what does the link respond (headers) ?
If you have to modify the headers, than it must use some kind of proxy.
精彩评论