dimanche 5 avril 2015

php : abount Content-Disposition header

A file named 'hashed.png' in server. and I can request like


"http://server_name/hashed.png"


but It's original name is 'hello.png' when I upload to server (It's relation is in db) and when I request that url and when download it, it named 'hashed.png'. I want to display it 'hello.png'


Summary : I want to do like this




  1. When I upload 'hello.png', server save it in 'hashed.png' + save in db relation of 'hello.png', 'hashed.png'. in php, I know 'hashed.png''s original name is 'hello.png'.




  2. When I request "http://ift.tt/1D7265y", image is display and when I try to save it, It's name is auto filled by 'hello.png'




I find named 'Content-Disposition' but, I don't know how to run php code when user request by image's direct url.


Help me!!


Aucun commentaire:

Enregistrer un commentaire