tags:

views:

70

answers:

1

looking for a solution to mask / use a different url of a file rather than the cloud hosted one.

for example, wish to display an image

TEST.JPG

from the url

http://cloud.filehosting.example.com/12345/asdfg/123455/sjklksgklshglhfjgl.jpg

as

http://mysite.com/image/TEST.JPG

how is this called (so i can actually look it up on google, having problems weeding out results without the common name)? and how can it be done?

the reason is that if people want to access their images directly, they should use a link from my site, not the clouds, but the file should be accessed from the cloud.

+1  A: 

It depends on how well hidden you want the "cloud" URL to be.

If you are OK with the user being able to discover the "cloud" URL, you can implement the functionality using simple redirect. When the user click on a link to your URL representation of the image, you just respond with 302 and ContentLocation header that has the actual URL for the file.

If you want the user to never be able to discover the "cloud" URL, you can write simple method on your server that makes a separate request to the "cloud" URL, reads the response and then sends it as a response back to the user.

Franci Penov
thank you. 302 it is :)
b0x0rz