hi
i have an application which accepts only the following extensions
jpeg
jpg
giff
tiff
bmp
doc
docx
pdf
and converts them to a single tiff file using imagick
.Now my question is not related to imagick in-fact it is about reading the original format of the file initially i was using a function to extract the extension from the file name then i swapped it by checking the mimetype and the reason was that if someone changes the file extension lets say for e.g there is an image named
ABC.png and someone changes it to ABC.DOC the application should give an error message.
The file you provided is not a valid doc format
but using the mimetype in the
$_FILES['file_name']['type']
it wont detect the original mimetype of the file infact it gives the mimetype 'application/msword' whereas the original mimetype was 'image/png' , now i am looking towards reading the metadata info of the file but would it help with both images and documents ,apart from it i have heard that it is not compulsary that every image would have the metadata info attached with it, guys i have done the big part of it all is done but this requirement is making me mad . Any help / helpfull link would be appreciated
regards,
Omer Aslam
i have an application which accepts only the following extensions
jpeg
jpg
giff
tiff
bmp
doc
docx
and converts them to a single tiff file using imagick
.Now my question is not related to imagick in-fact it is about reading the original format of the file initially i was using a function to extract the extension from the file name then i swapped it by checking the mimetype and the reason was that if someone changes the file extension lets say for e.g there is an image named
ABC.png and someone changes it to ABC.DOC the application should give an error message.
The file you provided is not a valid doc format
$_FILES['file_name']['type']
it wont detect the original mimetype of the file infact it gives the mimetype 'application/msword' whereas the original mimetype was 'image/png' , now i am looking towards reading the metadata info of the file but would it help with both images and documents ,apart from it i have heard that it is not compulsary that every image would have the metadata info attached with it, guys i have done the big part of it all is done but this requirement is making me mad . Any help / helpfull link would be appreciated
regards,
Omer Aslam
Comment