I tried to upload jpg files but it didn't work.
Is there any other way to upload jpg files without converting it into jpeg files?

Comments

BrightLoudNoise’s picture

@hyunkatie: Please provide some more detail so we can troubleshoot this.

  1. What specific error did you receive?
  2. Have you permitted jpg or jpeg file extensions on your field?
  3. What browser are you experiencing this issue in?
  4. Are you using the content permission module?
jpetso’s picture

Status: Active » Postponed (maintainer needs more info)
imkatie1’s picture

@BrightLoudNoise

1. What specific error did you receive? ==> It says I can upload only jpeg, png, gif.
2. Have you permitted jpg or jpeg file extensions on your field? ==> I think for 'filefield Image'module I cannot set file extensions. They are already set(jpeg,png,gif). Am I wrong?

3.What browser are you experiencing this issue in? ==> Internet Explorer 7 !

4. Are you using the content permission module? ==> no..

Thank you for your attention.

jpetso’s picture

While it is true that the help text says "jpeg, png, gif", the image widget uses mimetypes for determining the type of the file (as opposed to extensions, which you can specify manually). That means even if you upload a file named blah.jpg, the mimetype for it is image/jpeg and thus recognized by the image widget.

Stupid question, but did you actually try uploading the file or did you only read the help text? If the error really occurs with the actual upload, your browser might pass a wrong mimetype for the file, which would be solved by reintroducing the dependency on the MimeDetect module that we already depended on in the 5.x versions.

imkatie1’s picture

1. I uploaded actually in IE7, it really said I cannot upload because it is not jpeg, png or gif.
Exactlly it said like below
" The selected file xxxx.jpg could not be uploaded. Uploaded files are restricted to the following categories: Images (png/jpeg/gif)."

2. I experienced another strange thing several time.
Even though I didn't change any configuration of the content type with filefield_image field, 'File widgets' setting went to 'Generic files' from 'Images(png/jpeg/gif)'.

I remember somebody uploaded an issue saying he couldn't see images after he uploaded.
He/she found that the 'File widgets' setting was in 'Generic files' later.
He said that he knew he set that as 'Images(png/jpeg/gif)'.

I think he experienced very same thing as I experienced.

It happened in IE7 also.

So if that setting goes wrong, my theme becomes so ugly... like the structure is broken.

I hate IE7. Sorry about asking you too much things.
and Thanks~

nyl_auster’s picture

Hello
(sorry for my bad english) i just want to add that i experienced the same problem with IE6. No problem with FF.

exterminatorx’s picture

I'm getting the same kind of error, and here are the details of my problem. When uploaded a file via the widget, I get this error message:

The selected file picture.jpg could not be uploaded. Only files with the following extensions are allowed: .

Note that empty string in the error message about the allowed extensions.

Furthermore, this problem does not occur if I'm logged in as user=1. If I'm logged in (or others) that have a different role, they get the error message. User=1 is able to upload images just fine. I checked the permissions and everything seems in order. Perhaps I missed something?

adam640kb’s picture

I get the same error as #5 when trying to upload an image using IE7, works perfectly in FF3.

" The selected file xxxx.jpg could not be uploaded. Uploaded files are restricted to the following categories: Images (png/jpeg/gif)."

zzeng7712’s picture

same error here, works in FF but not IE7

jpetso’s picture

The selected file picture.jpg could not be uploaded. Only files with the following extensions are allowed: .

This was a bug in filefield, and is fixed with filefield 6.x-1.0-beta3.

The selected file xxxx.jpg could not be uploaded. Uploaded files are restricted to the following categories: Images (png/jpeg/gif).

If it works in FF but not in IE then IE is passing the wrong mimetype. The proper fix for that would be using the mimedetect module in filefield again, but for a stop-gap measure, you might find out which mimetype IE is passing to us (hint: do a drupal_set_message($file->filemime); in the suitability callback), then we could include it in the list of mimetypes that the FileField Image and FileField ImageCache modules support.

So, if you tell me the mimetype, you can have that workaround.

rikvd’s picture

ip posted the solution today here
it is been like this, since IE exists


you can solve that easily for IE7, change line 51 of filefield_image.module from

'image/jpeg', 'image/png', 'image/gif'

to

'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/gif'

B_u_f_o’s picture

and the same do in the file filefield_imagecache.module - line 96

hey :)

jpetso’s picture

Title: How can I upload jpg file? » Accept nonstandard IE7 mimetypes
Category: support » feature
Status: Postponed (maintainer needs more info) » Fixed

Fixed, and released as final release 6.x-1.0. I hope you find peace with this release, otherwise bad luck because I'm now gone from Drupal development for at least half a year. Have fun!

rikvd’s picture

enjoy your time without drupal :)
I like your comment ;)

Ocyrhoé’s picture

Status: Fixed » Needs work

You can also add another IE non standard mimetype: image/x-png

jpetso’s picture

Status: Needs work » Closed (won't fix)

This module is now phased out in favor of FileField/ImageField 6.x-3.0. All issues are "won't fix" because the module is essentially dead. Please have a look at the project page for some explanations.