WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => Modules => Topic started by: CodeALot on October 08, 2019, 11:46:36 AM

Title: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 08, 2019, 11:46:36 AM
* WB 2.12.2 r378
* Using OFA 2.0.2.23
* Plupload.min.js version v2.2.0
* Image resize on or off makes no difference
 
Whenever I try to upload a rather large file, I get the error

Code: [Select]
266 A file matching the name you entered already exists

When I then save the record, the image I uploaded shows as a thumbnail, but is only partially uploaded.
It's probably something in the hosting settings because some websites have this problem, others don't. Does anyone have any idea where to look?
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 08, 2019, 11:54:52 AM
Quote from: CodeALot
Yeah, I resize the images now before uploading ...
https://forum.WebsiteBaker.org/index.php/topic,31547.msg220811.html#msg220811

Resize more  :)
Your hoster allow maybe only 2MB
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 08, 2019, 12:29:24 PM
In the CONFIG.PHP of OFA is a definition of the maximum filesize (last lines in the file), why isn't that "kicking in" when I try to upload a too large file then? :-)
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 08, 2019, 12:37:00 PM
You mean this?
Code: [Select]
// Plupload max file size in MB
//$max_file_size           = 2;
\preg_match('/^\s*([0-9]+)([a-z])?\s*(_)?\s*$/i', ini_get('upload_max_filesize').'_', $aMatch);
$max_file_size = (int)$aMatch[1];

The original was the commented part
Code: [Select]
$max_file_size           = 2;Maybe it helps you use this part and comment out the other two lines.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: Gast on October 08, 2019, 01:25:38 PM
for example: on my private servers, the upload limit (upload_max_filesize) is set to 200Mb by default. the most of my customers has a upload_max_filesize with 128Mb

i can set OFA to this upload_max_filesize (200 Mb), but i can set also a limit in OFA, maybe 10Mb. With 200Mb-Limit, you can send only one single file (with 200 Mb),  with 10Mb-Limit = 20 files a 10 Mb. But in all this cases, i cannot set or change the server settings for upload_max_filesize with this setting in OFA - the base is my server setting



to the code from dbs:
this two lines read's the setting (from the php.ini on this server) and set this value automatically to the OFA-Setting, that means: in my case, it set OFA to 200 mb, because, i've a default value in php.ini with 200 Mb for upload_max_filesize
this code cannot change the upload_max_filesize, it read's only the setting and use it in OFA - old version was a hard-coded value like
Code: [Select]
$max_file_size           = 2;but then, i've to change it on every new server or after every server upgrade

check at first the php.ini, maybe with phpinfo() and search there for max_uploaded_filesi ze (size of a single file in the upload) and also the value of post_max_size (the summary of all content in a form, text and files). is there a small limit (like 2Mb), it is possible to change this in your .htaccess or in a php.ini / users.ini in the root folder of your wb-installation. Remember: post_max_filesize must be equal or higher than upload_max_filesize

P.S.: maybe somewhere in the upload-script (PLUpload), you found a code like this

Code: [Select]
ini_set('upload_max_filesize','30M');
ini_set('post_max_size','30M');

but it works not in every case. the most servers give's only the permission, to change the settings via .htaccess or users.ini, not via script

if you need it, trya code like this in your .htaccess (means 30 Mb)

Code: [Select]
php_value post_max_size 30M
php_value upload_max_filesize 30M
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 08, 2019, 03:03:32 PM
Thanks for all the efforts to help out here.
 
Meanwhile I found that I have two different domains on the same hoster using the same version of OFA, but only one of the two has the problems as described.
Weird thing is that they don't both seem to have the same *.js files dealing with the upload. I'll compare them later to find out why one works and the other doesn't.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 08, 2019, 03:23:58 PM
Code: [Select]
$max_file_size           = 2;I see it in such a way that the webmaster sets this value to prevent that the users upload too big pictures.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 23, 2019, 03:36:35 PM
Code: [Select]
$max_file_size           = 2;I see it in such a way that the webmaster sets this value to prevent that the users upload too big pictures.
Still, I think this is ridiculous. PLUPload is not working properly, period. My server limit to upload size is 32 MB.

In the MEDIA section of WB, I can without any problem add an image of 10 MB.
Ruud's MiniGallery handles that same 10MB image without a problem. Only OFA + Plupload won't do its job.

My client should be able to take a picture with his telephone or consumer camera and upload it to his website. The resize-option of OFA will then make sure it gets resized.
PLUPLOAD should be able to handle an image of 4 MB, instead it throws errors at you.

Conclusion: I want the old method of adding images to OFA back until the creators of PlupLoad realize it is indeed almost 2020 and images are BIG these days.

How do I go about this?
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 23, 2019, 03:40:48 PM
Meanwhile I found that I have two different domains on the same hoster using the same version of OFA, but only one of the two has the problems as described.

I was wrong. They both don't work properly.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: Gast on October 23, 2019, 04:58:20 PM
have you try to change the upload file size limit in config.php of the ofa-module?

Code: [Select]
// Plupload max file size in MB
$max_file_size           = 2;

P.S.: if everything is right on stackoverflow, this is the limit for a multiple upload,, not for one single file
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 23, 2019, 06:15:07 PM
No chance.
My Server allow 30MB.
My file is 3MB,
in config is 5 allowed.
Result: half images inclusive error message
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: Gast on October 23, 2019, 08:04:02 PM
half visible Image??
or half in the file size?
normalize a connection problem

the scripts like plupload, wb-intern upload etc check the filze size normalize before the upload starts

what is the exact error?
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 23, 2019, 08:32:34 PM
After upload only the message is visible. The file wood_texture.jpg is new, first try of upload.
Quote
wood_texture [267] Eine Datei mit dem angegebenen Namen existiert bereits
After reload of the page this there.
https://prnt.sc/pn7e7l (https://prnt.sc/pn7e7l)
3,5mb
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 23, 2019, 11:21:52 PM
After upload only the message is visible. The file wood_texture.jpg is new, first try of upload.
Quote
wood_texture [267] Eine Datei mit dem angegebenen Namen existiert bereits
After reload of the page this there.
https://prnt.sc/pn7e7l (https://prnt.sc/pn7e7l)
3,5mb
I confirm. Exactly what I see happening all the time. I am really surprised that not more people report this.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: Gast on October 24, 2019, 10:33:41 AM
i think, Dietmar is faster, but i'll try it

pls take a look into this file:  /var/log/oneforall.log.php  (replace oneforall with the used modulename for OFA)
and compare the time in the possible error message(s)

it looks like this
Quote
[Thu, 24 Oct 2019 08:21:34 +0000] {"jsonrpc":"2.0","OK":0,"error":{"code":202,"message":"[266] Eine Datei mit dem angegebenen Namen existiert bereits","filename":"875tvp89t5vo8_256","id":"id"}}

i get 3 errors for one single upload - same problem with the half picture
pls tell me, if the red marked part are different - it show's the error code and the line, where this message was generated

looks for me, that the default size with 2 Mb somewhere defined as hard coded value, but i'll check the path-problem at first
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 24, 2019, 10:47:14 AM
Yes, 3 entries at the same time, only one second different.
Red part is the same, since 30 December 2018.

I think also not plupload is the problem, it does what it should. If a pic is bigger as in config allowed: disallowed with red message.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: Gast on October 24, 2019, 12:14:21 PM
So, i think, i found a solution

the developers from PLUpload say's: its not realy clear with the chunk size, sometime, it works, sometimes not. If i understand everything correct, the code split the file into some parts with the defined chunk size, normalize in the case of very large images or if you have a bad connection and put all parts together after the upload
Defined chunk size in OFA was 1mb, defined Default Chunk Size in PLUpload is 204798 Bytes (overwritten from OFA), Filesize = 4mb, max_upload_size on the server = 40 Mb
that makes 4 parts with 1 mb for every part, the first part was uploaded, for the rest, you get the error "file already exist"
maybe, it has to do with the second step inside of OFA - build a thumbnail in a different folder, but i dont know.
In the PLUpload-Forum, some users reported, that they work with a chunk size of 5 Mb and a file size from 300 Mb without problem, but others have the same problems with the broken image

i use now the chunk size like my defined max_file_size in modify_item.php of OFA  // Lines 694 + 695

Originalcode:
Code: [Select]
            max_file_size: '<?php echo $max_file_size?>mb',
            chunk_size: '1mb',

change to

Code: [Select]
            max_file_size: '<?php echo $max_file_size?>mb',
            chunk_size: '<?php echo $max_file_size?>mb',

maybe, somewhere in the code is a switch to disable the chunk function

P.S.: lastest version from PLUload (https://www.plupload.com/) has the same problems

i'm not sure - is this now a good solution or not, but maybe, it show's the way for Dietmar
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 24, 2019, 12:41:37 PM
Nice  (Y)
It's a workaround. Most people don't need it because the images should be so small as possible.
But for photographer or image sharer is it a easy and small change.
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: CodeALot on October 24, 2019, 07:23:07 PM
Nice  (Y)
It's a workaround. Most people don't need it because the images should be so small as possible.
But for photographer or image sharer is it a easy and small change.

That's where you're wrong. Most people DO need it. My clients want a userfriendly website. They don't know how to resize images and as a website builder, I think they should not have to bother with that.
 
They take pictures with a smartphone or digital camera and those images are always too big for OFA+Plupload. That's why OFA offers to resize the images. But if that doesn't work like it should, it's useless.
 
Thanks all for thinking about this and the workaround. I'll give that a go!  (Y) (Y)
Title: Re: OneForAll - Img upload [266] A file matching the name you entered already exists
Post by: dbs on October 24, 2019, 09:01:07 PM
I agree. Have also some users who tried to upload >= 3MB files.