snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Unable to upload Image for Assets which is

Open ashaerotech opened this issue 1 year ago • 14 comments

Debug mode

Describe the bug

Settings >>Assset Models >>Actions >> Update >> Upload Image

Accepted filetypes are jpg, webp, png, gif, and svg. Max upload size allowed is 2M.

This image file was not readable. Accepted filetypes are jpg, webp, png, gif, and svg. A 500 file server error also occurs

Note: The image uploaded is 24 KB asset models imagre problem

Reproduction steps

ticket for expansion mic 2. asset models imagre problem

Expected behavior

The Image of the respective Assest should be uploaded.

Screenshots

500

Snipe-IT Version

v6.1.0 build 10161 (ga8ca3ad2a)

Operating System

Windows 10 Enterprise

Web Server

Apache

PHP Version

7.4.13

Operating System

Windows 10 Enterprise

Browser

Microsoft Edge

Version

1.3.175.27

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

ashaerotech avatar Jun 01 '23 13:06 ashaerotech

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

welcome[bot] avatar Jun 01 '23 13:06 welcome[bot]

We'd need to know what the 500 error is in the logs.

snipe avatar Jun 08 '23 17:06 snipe

the 500 server error was a refernce image which i took a screenshot from a ticket which was open before who had the similar problem like we had but there was no solution there. Sorry for the confusion !!! but we have the same 500 error before

ashaerotech avatar Jun 13 '23 06:06 ashaerotech

snipe it ticket

ashaerotech avatar Jun 13 '23 07:06 ashaerotech

snipe it ticket 2

ashaerotech avatar Jun 13 '23 07:06 ashaerotech

snipe it ticket 3

ashaerotech avatar Jun 13 '23 07:06 ashaerotech

when uploade it shows this and have tried different formats snipe it ticket 4

ashaerotech avatar Jun 13 '23 07:06 ashaerotech

Edit: Saw OS Windows and totally skipped over that you're using Apache. Sorry. (Leaving it up as this will resolve other Windows IIS users problems as this is literally the only search result for snipe it "This image was not readable")

If you didn't already, check the permissions of folders on the host. The following link shows exactly what permissions are required. My Windows/Temp folder did not have the correct perms, I had the same issue and it was resolved.

https://snipe-it.readme.io/docs/windowsiis#fix-permissions

Snipe-IT Documentation
Setting Up an IIS Website📘NOTE:For the purposes of this walkthrough, we are assuming you're using assets.portal.local as your Snipe-IT local domain name. This should be changed for your own installation. Extract Snipe-IT to C:\inetpub\wwwroot\snipe-it (folder name can be changed but we will referen...

Nung221 avatar Jun 25 '23 14:06 Nung221

I checked all my permissions according to the documentation as mentioned as @Nung221 - I did update the verbs I was missing for my PHP mappings and still coming across the same issue.

I am using the same PHP version as OP on Windows 2022 IIS. Hoping someone else is running into the same issue.

jx0c avatar Sep 25 '23 15:09 jx0c

@ashaerotech I had this problem also. The guide mentions adding in the IUSR account which didn't work. I then tried adding the same permissions but for the IIS AppPool\AppPoolName account and it's working for me.

ChrisRobb93 avatar Nov 17 '23 19:11 ChrisRobb93

I changed the following in the php.ini file ( around line 845 ish) located in /etc/php/7.4/apache2

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

then I ran the command (in my Ubuntu) sudo service apache2 restart

akivacp avatar Dec 26 '23 19:12 akivacp

Can confirm it is still an issue. Running windows server 2022 System Information Snipe-IT version: v6.2.4-pre build 12343 (gb23ce6cfc) Software License: AGPL3 PHP Version: 8.1.27 Laravel Version: 8.83.22 Timezone: America/Los_Angeles Database Driver

Branding, assests and the link. Only thing I was able to upload was a favicon.

I followed everyone's tips and tricks to no avail.

TMFuzz avatar Jan 06 '24 00:01 TMFuzz

I absolutely don't know why but when I added full control to IUSR in C:\Windows\Temp it started working. Despite the fact that I had already added there IIS_IUSRS group where is IUSR member 🙄

dimmuboy avatar Jan 31 '24 15:01 dimmuboy

Can confirm it is still an issue. Running windows server 2022

It really isn't tho. This is server permissions, not an app level thing.

I absolutely don't know why but when I added full control to IUSR in C:\Windows\Temp it started working.

magic.gif? :D

snipe avatar Jan 31 '24 20:01 snipe

Thank you for this post, which pointed me in the right direction. Same symptom and same solution for me! It happened to me for me after a Windows server 2019 to 2022 upgrade ! It is look like the permissions for the IIS user for the Windows Temp folder disappear during this process and need to be set back !

AiR-0nE avatar Mar 15 '24 08:03 AiR-0nE