bm4499 Posted March 30, 2010 Share Posted March 30, 2010 Does anyone know hot to get a pop-up messagebox that allows visitors of an url (e.g. http://www.mysite.com/image1.png )to open / download / cancel the file. With a *.zip file it works automatic like http://mysite/test.zip but with an image the image automatically opens in your browser Quote Link to comment https://forums.phpfreaks.com/topic/196968-how-to-opendownload-an-image/ Share on other sites More sharing options...
beta0x64 Posted March 31, 2010 Share Posted March 31, 2010 Whenever you link a person to part of your webpage, you are telling them to access a file on that page. The browser interprets what to do based on what kind of ending it is (php/html: display content, filetypes (zip, rar, bin, exe, etc.): show download, images: show image). So, you can apparently set the header content-disposition which will override this behavior. Look here: http://support.microsoft.com/kb/260519 I would take them to a php page that sets the header then jquery that loads the image and outputs it to the user? I'm not sure how to do this, to be honest. Actually, that wouldn't work. You would have to load the image with php so there would be no other html present, but do change the header. This could take some experimentation to get to work! It's a lot simpler to educate the user perhaps with a hover tooltip/div of some kind? Quote Link to comment https://forums.phpfreaks.com/topic/196968-how-to-opendownload-an-image/#findComment-1034493 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.