Dont download image when right clicked, open in new tab - spring boot -


@timed @requestmapping(     value = "/{user}/images/**",     method = requestmethod.get ) responseentity<inputstreamresource> findimage(@pathvariable string user,                                               httpservletrequest request) throws ioexception {      httpheaders headers = new httpheaders();     headers.add(httpheaders.cache_control, "no-cache, no-store, must-revalidate");     headers.add(httpheaders.pragma, "no-cache");     headers.add(httpheaders.expires, "0");     headers.add(httpheaders.content_disposition, "attachment; filename=\"" + filename + "\"");           inputstream inputstream = storage.getinputstream(imagepath);         return responseentity.ok().headers(headers)             .contenttype(mediatype.application_octet_stream)  } 

when user click zoom button, method called , shows image on ui zoomed. when user right clicked view, calls method , downloads file.

how can disable downloading, should show in new tab? dded did not work

 headers.setcontentdispositionformdata("inline", filename); 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -