Error: The file type is not allowed - file cannot be uploaded

Phoca Cart - complex e-commerce extension
User avatar
shibumi
Phoca Enthusiast
Phoca Enthusiast
Posts: 97
Joined: 11 Sep 2016, 22:22

Error: The file type is not allowed - file cannot be uploaded

Post by shibumi »

I am creating an online digital photo store that will provide both JPEG and DNG (digital negatives) files, I have added "image/x-adobe-dng" to legal MIME types, and added dng and DNG to both Legal Extensions (File Types) and Legal Image Extensions (File Types) and still I cannot upload any .dng files... and yes, I did increase my max upload file size to accommodate the larger .dng files - what am I missing? Even with everything I tried, I am still getting "Error: The file type is not allowed - file cannot be uploaded"

Max Post Size and Max Upload Size are both 32MB, and the DNG files I am uploading are around 24-26MB in size... I'm not getting an error about file size, I get error file type is not allowed and I tried turning off Restrict uploads and Check MIME Types... still the same error message: "Error: The file type is not allowed - file cannot be uploaded"

The key thing here I think is the "The file type is not ALLOWED" not the file type is not supported, or file over upload limit.
User avatar
shibumi
Phoca Enthusiast
Phoca Enthusiast
Posts: 97
Joined: 11 Sep 2016, 22:22

Re: Error: The file type is not allowed - file cannot be uploaded

Post by shibumi »

I put a post in the Joomla forums as well, and response was check with PhocaCart forum... one person said they were able to upload a DNG file through the media manager, but my problem is I am not able to use media manager as my downloads folder is outside of public_html folder so as to protect my downloadable files.

I was also successful in uploading a DNG file through media manager, but doesn't do me any good.

Is there any setting in PhocaCart that allows you to set file types that are allowed to be uploaded to your private uploads directory?

Thanks,

Jeff
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: The file type is not allowed - file cannot be uploaded

Post by Jan »

Hi, if you are using folder outside the public_html folder, I think you should upload the files there per FTP :idea:

Where exactly do you try to upload the files now? Can you paste a screenshot?

Jan
If you find Phoca extensions useful, please support the project
User avatar
shibumi
Phoca Enthusiast
Phoca Enthusiast
Posts: 97
Joined: 11 Sep 2016, 22:22

Re: Error: The file type is not allowed - file cannot be uploaded

Post by shibumi »

So, I kind of have a workaround for this... when I am setting up a new product, it generates random folder names in my /home/username/download... folder, where each downloadable photo is in its own folder... my website is in /home/username/public_html. Once the folder name is generated for the DNG file I want to add, I upload it to that folder through my cPanel's file manager, then go back to PhocaCart and choose the file that is associated with that folder. It's a lot more time consuming and makes the workflow a lot longer and more complicated, but it works for now... although, it would be nice to just upload the DNG file directly from PhocaCart and not have to take the extra steps.

I can upload .jpg, .zip, just not .dng...
Image
Image
User avatar
shibumi
Phoca Enthusiast
Phoca Enthusiast
Posts: 97
Joined: 11 Sep 2016, 22:22

Re: Error: The file type is not allowed - file cannot be uploaded

Post by shibumi »

Jan, I should also mention that I can successfully upload .jpg and .zip files through PhocaCart with no issues to the /home/username/downloads folder, I just get the error when trying to upload .dng files - DNG is a Digital Negative file, which is similar to a camera RAW file... I essentially will have 4 sizes of each "catalogue" item, and will probably end up with potentially hundreds of images for sale, so, having to manually upload each .dng file to the proper folder through ftp or cPanel file manager, and then go back into PhocaCart and select that image to assign it to the downloadable file could get very complicated as the catalogue grows.

Is it possible there is some setting in PhocaCart that says what are allowed file types that is causing this error for the .dng files? With Joomla core for media types, I added dng and DNG to Legal Extensions (File Types) and Legal Image Extensions (File Types) as well as image/x-dcraw and image/x-adobe-dng to Legal MIME Types and I can upload dng files through Joomla's media manager. I even tried turning off Restrict Uploads and Check MIME Type, but I believe that this only applies to files being uploaded to the /images folder.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: The file type is not allowed - file cannot be uploaded

Post by Jan »

Hi, in new version 3.3.1, there will be new parameter: Ignore File Types Checking for disabling the checking of the file types.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: The file type is not allowed - file cannot be uploaded

Post by Jan »

Hi, added into version 3.3.1:
https://www.phoca.cz/news/1056-phoca-ca ... 1-released

Please test and let me know.

Thank you, Jan
If you find Phoca extensions useful, please support the project
User avatar
shibumi
Phoca Enthusiast
Phoca Enthusiast
Posts: 97
Joined: 11 Sep 2016, 22:22

Re: Error: The file type is not allowed - file cannot be uploaded

Post by shibumi »

Jan! You're awesome buddy! It worked... It would be nice if in a future version there was an option to set the file types allowed similar to the Joomla media manager options... it's interesting that if your extension is using the Joomla configuration for allowed file types that it allowed uploading jpg, png, gif, zip, but not recognizing dng and blocking it... is there a function somewhere in your code that checks against allowed file types? If so, where is it located?

Thanks,

Jeff
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: The file type is not allowed - file cannot be uploaded

Post by Jan »

Hi, yes, there is an internal function which is not added to parameters like by e.g. Phoca Download, the reasons are:

- such parameter includes a lot of data and can slow down loading parameters (in frontend this is critical)
- for now there is no frontend upload, only admin so in fact ignoring the checking of file mime types is not a problem
- the list you can find here: administrator\components\com_phocacart\libraries\phocacart\utils\settings.php - it is a fixed list (see the first argument) for now. It can be possible in future to move it to parameters, when e.g. there will be more upload features. But for now the performance has more priority.

Jan
If you find Phoca extensions useful, please support the project
User avatar
shibumi
Phoca Enthusiast
Phoca Enthusiast
Posts: 97
Joined: 11 Sep 2016, 22:22

Re: Error: The file type is not allowed - file cannot be uploaded

Post by shibumi »

Okay, I'll take a look, at the very least to be able to add dng file type and image/x-adobe-dng mime type would be nice...

Thanks Jan

Jeff

This section of code?

Code: Select all

	public static function getDefaultAllowedMimeTypesUpload() {
Post Reply