Author Topic: OneForAll - Img upload [266] A file matching the name you entered already exists  (Read 95 times)

Offline CodeALot

  • Posts: 442
  • Gender: Male
* 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?

Offline dbs

  • Betatester
  • **
  • Posts: 8075
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
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

Offline CodeALot

  • Posts: 442
  • Gender: Male
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? :-)

Offline dbs

  • Betatester
  • **
  • Posts: 8075
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
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.

Offline jacobi22

  • Posts: 5891
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline CodeALot

  • Posts: 442
  • Gender: Male
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.

Offline dbs

  • Betatester
  • **
  • Posts: 8075
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
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.

 

postern-length