i want to allow users to upload .png / .jpg / .PNG / .gif
The rule am using now only allows .png :
https://i.stack.imgur.com/7UujZ.png
image\\.png is not a content type.
request.resource.contentType.matches('image/jpeg')
|| request.resource.contentType.matches('image/png')
|| request.resource.contentType.matches('image/gif')
(Please do not upload screenshots but show text instead.)
Related
The png and jpg images of my Wordpress site are programatically converted into webp formats thanks to an extension (I've tried different, including WebP Converter for Media and WebP Express).
There are pages that display an image. I would like to add a button that enable users to download the image. I'm currently using the following code :
<a href="path/to/my/img.png" download="img">
<button type="button"> Download </button>
</a>
Nevertheless, upon hit, the image to be download corresponds to its webp version - not the png as encoded in the image path.
I would like to know :
Is it possible to force the server to serve the png image upon button click, either with a client side information (included in the image path, or in the ?) or with a server side condition (if page==X and request==Y, return png)?
(Worse but possible) Is it possible to prevent the server from converting png to webp, either by excluding some pages in a given extension, or by adding some php functions directly in the code ?
Otherwise, what other strategies have I missed to have webp images rendered but the ability to easily save as png?
Note: Chrome works as expected : png instead of webp image upon download, and, webp image upon save as on image directly. Firefox though download images as webp wether it is on the image or through the download button.
I haven't find a definitive general answer, but apparently, the WebP Express plugin skips URLs that contain a query string.
Therefore, if you ?original to the image URL in the link, you would "force" the serve not to encode your original png image into a webp format.
This just writes :
<a href="path/to/my/img.png?original" download="img">
<button type="button"> Download </button>
</a>
Note : I don't know whether this works with other plugins.
I am downloading images using wget for a learning project which i am succcesfully able to do. However, some sites have all images titled with the same name - in such cases, is it possible for wget to read the title of the images in the page and output the images with the title name ?
For example if all the images would by default be saved as 1.jpg I would like them to be saved as .jpg where ImageTitle is derived from the Title of the image.
Thanks.
I am using Karma commercial template. I have make the plugin for to upload document or any type of file, which will save in database and give option of Preview in front end. I have search many plugins for the same. I don't want to download the file but only wanted to preview the file in read only mode.Please help for the same.
I have used javascript code using javascrip plugin:
var documentViewer = $('#document-preview').documentViewer();
But it is not usefull for word file as it is useful for image, pdf and text file.
The Google Document Embedder plugin allows you to display files (PDF, Word, etc.) and has options that will prevent downloads.
http://wordpress.org/plugins/google-document-embedder/
I want to load the EXIF thumbnail preview stored in a jpeg image located on a remote server, without having to download the whole image. The server does not support resuming.
Is this possible? In detail, can I assume that the thumbnail image data is alway before the full image data so that I only have to download a maximum of (e.g.) 100kb which I can parse for the thumbnail data?
I was asking the same question and found this Greasemonkey script which adds thumbnail images to an Apache auto index page.
https://userscripts.org/scripts/review/5390
For each JPEG image link it issues a range request for the jpeg / jfif header, parses the thumbnail offset and thumbnail length tag then issues a further range request for the thumbnail, creates a data uri and assigns it to a new img object.
Unfortunately it only works for certain JPEG file formats.
i have a pdf file and want to allow user to upload a gif file of their signature and display the signature in my pdf file...
pls follow the link
http://support.persits.com/pdf/demo_fill.aspx
http://www.asppdf.com/livedemo.html -> template fill out
You can use iTextSharp to insert an image in a PDF. See the example: iTextSharp - Working with images.