File permissions on Windows (IIS) servers

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

File permissions on Windows (IIS) servers

Post by Klemen »

Hello,

Quite some people are having problems with setting correct permissions to folder attachments and file hesk_settings.inc.php

CHMOD doesn't work on Windows servers, this is a Unix command. On windows servers you need to set correct permissions like this:

1. right-click on the file (or folder) and select Properties
2. select Security tab
3. under Group find Internet Guest Account (IUSR_xxx where xxx is the name of your computer)
4. in Permissions for Internet Guest Account under Allow select:
x Modify
x Read & Execute
x Read
x Write
5. Click Apply and OK

Do this for folder attachments and file hesk_settings.inc.php

Then run the Hesk installation test again and it should show both as Writable.


Q: I don't have the Security tab in Properties?
A: Open Explorer, slect menu Tools > Folder options, go to tab View and under Advanced settings un-check (make sure it's NOT selected) Use simple file sharing. Click Apply and Ok.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
valverde
Posts: 6
Joined: Fri Jun 01, 2007 8:43 am

Error Uploading Attachments

Post by valverde »

I have succesfully upgraded the script, but when I try to attach a file to a ticket I get the following error:

PHP Warning: move_uploaded_file(/httpdocs/sat/attachments/LUQR18Y77A_6968_Festivos_1.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\Inetpub\vhosts\inspired.com.es\httpdocs\sat\inc\attachments.inc.php on line 58 PHP Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\phpB69.tmp' to '/httpdocs/sat/attachments/LUQR18Y77A_6968_Festivos_1.jpg' in C:\Inetpub\vhosts\inspired.com.es\httpdocs\sat\inc\attachments.inc.php on line 58

I'm running my script in a Windows 2003 shared hosting server

Regards,
Antonio Valverde
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

PHP probably doesn't have permission to write to the "attachments" folder. Please double-check that you set the correct permissions (as explained above) to the attachments folder, if you have problems start a new thread.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
radfo
Posts: 1
Joined: Wed Sep 28, 2011 5:01 am

Re: File permissions on Windows (IIS) servers

Post by radfo »

I've set everything as recommended in your post and I've done everything as described in the other posts for attachments not working and I still get the same error.

Cannot move file to the attachments folder, please check your server path settings

Not sure what's going on.
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: File permissions on Windows (IIS) servers

Post by Klemen »

Possible causes:

1. Folder "attachments" doesn't exist

2. The "System/root path:" setting isn't correct (Admin panel > Settings > Help Desk).

3. The permissions for the attachments folder aren't correct

4. File uploads are disabled in your PHP.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
robmalt1
Posts: 1
Joined: Tue Dec 20, 2011 6:04 pm

Re: File permissions on Windows (IIS) servers

Post by robmalt1 »

You must also give the internet guest account rwx permission to the temporary folder.

If you follow the directions in this post you can get the error code(s) explaining why your upload is failing.

After you get the error code(s) you can look them up here.
osama.abbas
Posts: 1
Joined: Tue Apr 09, 2013 2:29 pm

Re: File permissions on Windows (IIS) servers

Post by osama.abbas »

I have got this error:

File upload failed, try with a smaller or no file attachment

and solve it by creating the folder (Temp) in the following path (D:\Program Files\PHP\) of my server

then give the users of the server full control on this folder

finally I have updated php.ini

upload_tmp_dir="D:\Program Files\PHP\Temp"


this enables me attach files in the ticket.

I hope this help you
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: File permissions on Windows (IIS) servers

Post by Klemen »

Thanks for sharing your solution!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply