boonex / dolphin.pro

Dolphin.Pro - Social Network Platform
http://www.boonex.com
MIT License
146 stars 138 forks source link

Files (photos, videos, etc): when uploading many photos only first 1-3 are uploaded #671

Closed AlexTr closed 5 years ago

AlexTr commented 5 years ago

Files модуль. Если сразу выбрать 3 и более файлов (пробовал на разных наборах), то после заливки первого, иногда после второго процесс останавливается. Ошибка следующая:

Type     PDOException
Message     SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1549632281' for key 'Uri'
File     /home/demoz/public_html/d7/inc/classes/BxDolDb.php
Line     164

Похоже, что понт именно в аплоадере, тк он легко воспроизводится в модуле фоток.

Additionally the following error maybe related during files upload:

<br />
<b>Catchable fatal error</b>:  Argument 1 passed to BxDolExceptionHandler::handle() must be an instance of Throwable, instance of PDOException given in <b>/.../inc/classes/BxDolExceptionHandler.php</b> on line <b>16</b><br />
manadi commented 5 years ago

Because security reasons, some hosting limits the script function for "readfile ()" it causes the Image we upload cannot be loaded, as a solution the script is changed to "echo file_get_contents ()", in the file "modules/boonex/photos/classes/BxPhotosModule.php" and "inc/classes/BxDolTwigModule.php", so the image can be loaded properly, but i do not know if the replacement of the script will affect to other functions.

AlexTr commented 5 years ago

@manadi thank you for this note, readfile is more desirable because it's buffered, we'll add checking for this function in audit, so user will know if necessary function is disabled - https://github.com/boonex/dolphin.pro/issues/676