Closed tmvillain13 closed 3 years ago
Are there any file size restrictions on your web server?
No, it is my own NAS
@EarlRamirez I have copied a custom .ini file into /etc/php/7.0/apache2/conf.d of my docker container of the snipeit
with the next lines: upload_max_filesize = 8M post_max_size = 8M
And it started to work.
So I assume there is still a bug in the default docker image, how this setting is set and / or used in code.
@tmvillain13 thanks for the update, never used the docker images but will certainly have a look and create a PR if your solution doesn't create any conflicts.
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
UP
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
+1 . Relevant for us
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.
Issue is still relevant. Encountered it today on a new SnipeIT docker installation
I am running into this as well. Can we re-open the issue?
Yep had the same experience on a new Snipe installation. This must be sorted as the software is not functioning as stated
same problem here also
For those still having an issue, I had a similar issue and fixed it by editing /etc/php/7.2/apache2/php.ini
and changing. Hopefully this helps someone.
upload_max_filesize = 2M
to upload_max_filesize = 10M
This is still an issue on the latest docker version.
/etc/php/7.1/apache2/php.ini has upload_max_filesize = 2M
@snipe this problem is still present in the latest Docker Image.
Most users using the software from Mobile or Tablets cannot choose the file size of the photo that the camera will make. So this will become more problematic moving forward as newer cameras will generate bigger images by default.
For this use case's it would be useful to have a resize checkbox when uploading a photo. [Upload image] [x] resize to 1600px
@baditaflorin the limitation is on the server end. We do resize image uploads, but there are PHP limitations on file uploads. We attempt to check what the server is configured to handle and disallow anything higher than that, since the server will reject the upload if it’s larger than that.
I am using the Docker container. It would be useful if we could set this when starting the container
On Sat, Nov 14, 2020, 23:19 snipe notifications@github.com wrote:
@baditaflorin https://github.com/baditaflorin the limitation is on the server end. We do resize image uploads, but there are PHP limitations on file uploads. We attempt to check what the server is configured to handle and disallow anything higher than that, since the server will reject the upload if it’s larger than that.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/6251#issuecomment-727266845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARZC52QDPARXAXWZS6R233SP3X6TANCNFSM4FXW775A .
We can fix this in the Dockerfile itself without too much difficulty. I'll re-open this and put it on my plate.
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Issue is still present in the latest docker image, please fix:
root@snipe-it:/var/www/html# grep "upload_max_filesize" /etc/php/7.2/apache2/php.ini
upload_max_filesize = 2M
@dannyhanes
"For those still having an issue, I had a similar issue and fixed it by editing /etc/php/7.2/apache2/php.ini
and changing. Hopefully this helps someone.
upload_max_filesize = 2M
to upload_max_filesize = 10M
"
I am somewhat new. I found the correct path and used "root@snipe-it:/var/www/html# grep "upload_max_filesize" /etc/php/7.2/apache2/php.ini" as suggested above by @dima-ser to be sure.
What command do I need to use to change it from 2M to 10M?
Regards
@uberbrady can you please address this when you're back from vacation? Thanks :)
Having the same issue.
Based on the information here this line added to the dockerfile should fix the problem:
RUN sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 8M/' /etc/php/7.2/apache2/php.ini
@dannyhanes
"For those still having an issue, I had a similar issue and fixed it by editing
/etc/php/7.2/apache2/php.ini
and changing. Hopefully this helps someone.upload_max_filesize = 2M
toupload_max_filesize = 10M
"I am somewhat new. I found the correct path and used "root@snipe-it:/var/www/html# grep "upload_max_filesize" /etc/php/7.2/apache2/php.ini" as suggested above by @dima-ser to be sure.
What command do I need to use to change it from 2M to 10M?
Regards
@kmpc808 I'd strongly recommend that you manually edit the Apache2 php.ini file (the server configurations that @snipe mentioned on 14-NOV-2020)
You can use just about any file editor (I use NANO) from the cli as follows - I'm using php 7.4 your version may be different:
1) sudo nano /etc/php/7.4/apache2/php.ini 2) at line 694 (or there abouts) change the 'post_max_size' variable to your desired size limit 3) at line 846 (or there abouts) change the 'upload_max_filesize' variable to your desired size limit 4) save and exit via CTRL+X and Y to save modified buffers 5) restart apache2 via: sudo systemctl restart apache2
I'm not 100% sure if a git-pull (the recommended update method) will over write these changes - I doubt it, but maybe @snipe or @uberbrady can comment for certainty. Otherwise, it's a pretty straight-forward and common change that is pretty easy to accomplish.
It’s definitely a good question - but, no, we do not overwrite php.ini values anywhere that I know of. And if we do, we should probably not.
Can you please increase the upload size for the docker container?THanks!
I'd be happy to take a PR that made the above-mentioned change if it works.
I'd be happy to take a PR that made the above-mentioned change if it works. @uberbrady Sorry. Not completely understood :) Do I need to open some requests?:)
If you can create a Pull Request (PR) with your proposed changes, I would be happy to accept (and merge) them.
@uberbrady I am not knowledgeable enough for PR
But I want to confirm that replacing upload_max_filesize = 2M
to upload_max_filesize = 10M"
in /etc/php/7.2/apache2/php.ini
solves the problem
For whoever is interested you can do it simply by connecting to the container and running the command:
find /etc/php/*/apache2 -type f -name php.ini -exec sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 8M/' {} \;
This based on the proposal by @bwint but will work for any version of PHP
@stepanov1975 thank you for this! was jumping through hoops trying to figure this one out. really appreciate it.
@jcookatlas also thank you for the help as well!
@stepanov1975 thank you using docker you can also just add "upload_max_filesize = 10M" to "/php/php-local.ini" and restart the container this will override php.ini directives according to the comment in "/php/php-local.ini"
With ^this new way, a was able to increase upload limit limit to 8M. But I've set the number to 50M.
My steps:
upload_max_filesize = 50M
, save the file, down docker, up dockerI even tried to modify .env
file to add (documentation)
# Docker-specific variables
PHP_UPLOAD_LIMIT=50
And even tried that to add as env value to docker-file:
services:
snipeit:
...
environment:
- PHP_UPLOD_LIMIT=50
And still displaying only 8M
if you typo'ed the upload limit - as PHP_UPLOD_LIMIT
- then it won't work.
But when I change that environment variable, it does change the maximum upload size for me.
On Wed, Aug 31, 2022 at 4:05 AM SonGokussj4 @.***> wrote:
With ^this new way, a was able to increase upload limit limit to 8M. But I've set the number to 50M.
My steps:
Open snipeit asset, upload, select file bigger than 2MB, error Open mounted /php/php-local.ini, add a new line upload_max_filesize = 50M, save the file, down docker, up docker open snipeit asset, upload, select file 6 MB, everything works (but it shows 'upload size allowed is 8M' select file 40 MB, upload, error - form timeout
I even tried to modify .env file to add
Docker-specific variables
PHP_UPLOAD_LIMIT=50
And even tried that to add as env value to docker-file:
services: snipeit: ... environment:
- PHP_UPLOD_LIMIT=50
And still displaying only 8M
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
I'm sorry, that was a mistake I wrote here in my message. In reality, I wrote PHP_UPLOAD_LIMIT=50
Then I ran docker-compose down; docker-compose up -d
Okay, so I just noticed new Changelog resolved ISSUE for version 6.0.10
(I was on 6.0 9
) for Docker not recognizing PHP upload limit.
So I've updated to 6.0.10
and... Still doesn't work. Still 8M.
I went into /php/php-local.ini
and deleted the upload_max_filesize = 50M
line.
Now it shows 2M again.
It's like it isn't reflecting my docker-compose setting (but other settings, like for the MAX_RESULTS, API_THROTTLE are working without a problem).
I've edited once again /php/php-local.ini
with both:
upload_max_filesize = 50M
post_max_size = 50M
And now it works! At least. But still ignoring setting in my Docker-Compose file ¯_(ツ)_/¯
Please confirm you have done the following before posting your bug report:
Describe the bug While uploading a file onto Asset via "Upload" button or "Edit Asset" and "Select Image" in the bottom, the help-block states that allowed maximum file size is 8M, but actual allowed file size is 2M
To Reproduce Steps to reproduce the behavior:
Expected behavior
File is Uploaded OR Help-Box show 2M OR I would have this setting added to the snipeit ENV
Screenshots
Server (please complete the following information):
Desktop (please complete the following information):
Smartphone (please complete the following information):
Error Messages he given data failed to pass validation. /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php#125 Illuminate\Validation\ValidationException
Demo server has 1024M help-box, I tried to upload 700M it did work.
Additional context