# Can't attach documents to a task

**URL:** <https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424>\
**Category:** Questions\
**Created:** [June 6, 2019, 9:04am UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424 "2019-06-06T09:04:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![avangeel](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/avangeel/32/205_2.png) [@avangeel](https://kanboard.discourse.group/u/avangeel)\
**Post date:** [June 6, 2019, 9:04am UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/1 "2019-06-06T09:04:40Z")

</div>

Hi all,

I need some help regarding an issue I have. Kanboard works like a charm, however I can’t upload files to a task. What happens is that the progress bar sticks to 100% and I never get the message “All files have been uploaded successfully.” In short the progress bar stays at 100% forever. The only thing I can do is cancel the action. When I enable debugging I only get the cryptical entry in the logging:  
[2019-05-20 08:52:59] [debug] Kanboard\Core\Controller\Runner::executeController =\> \Kanboard\Controller\TaskFileController::save  
[2019-05-20 08:52:59] [error] File not uploaded: 6

I checked all the settings (like php.ini), but can’t find anything wrong.

Does anyone has some tips how to troubleshoot this or has the answer? I would really appreciate some help.  
Kanboard is installed on windows 2016 with mysql as database and PHP7.2.7.

Thanks in advance,

Allan

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [June 6, 2019, 10:11am UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/2 "2019-06-06T10:11:39Z")

</div>

Permissions to data folder, maybe?

---

<div class="post-metadata">

**Author:** ![avangeel](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/avangeel/32/205_2.png) [@avangeel](https://kanboard.discourse.group/u/avangeel)\
**Post date:** [June 6, 2019, 12:19pm UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/3 "2019-06-06T12:19:27Z")

</div>

Thx for your reply.

The webserver user (IUSR) has modify rights on the “data” folder of kanboard. So that should be correct.

The extra challenge I have is that I can’t access the production system directly. I have a test system where I have full control. On this system I can’t reproduce the behavior. If I set incorrect file permissions on the test system at least I get the message “Unable to upload files”:

 ![UploadWrongPermissions](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/1X/738a986aac82672ffc504c3d9272574654e3ec19.png)  
and not a progress bar sticking to 100% where nothing happens.

Hope I make myself clear here and someone can help me out.

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [June 6, 2019, 3:50pm UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/4 "2019-06-06T15:50:50Z")

</div>

permissions is really the only thing that would give you 100% and then not go any further. If it was server upload limit, it wouldn’t give you 100%.

If you look at the TaskFileController-\>save(); method, you will notice, the only error message you could get there is “Unable to upload files, check the permissions of your data folder”, and that is where it is dying.

> <https://github.com/kanboard/kanboard/blob/9eb42aae335ed8f5f5e9e8efb11ac71155ca3e81/app/Controller/TaskFileController.php#L60>

> <https://github.com/kanboard/kanboard/blob/9eb42aae335ed8f5f5e9e8efb11ac71155ca3e81/app/Controller/TaskFileController.php#L66>

You may not have flash enabled to prevent the second error from showing, would be an explanation as to why you aren’t getting it.

9 to 10 odds, permission issue.

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [June 6, 2019, 3:57pm UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/5 "2019-06-06T15:57:25Z")

</div>

Although, your’s is actually failing here, odds 5/10 permissions now…just not to the data folder:

`[error] File not uploaded: 6`

> <https://github.com/kanboard/kanboard/blob/9eb42aae335ed8f5f5e9e8efb11ac71155ca3e81/app/Model/FileModel.php#L313>

Error #6 is tmp folder issue: [https://www.php.net/manual/en/features.file-upload.errors.php](https://www.php.net/manual/en/features.file-upload.errors.php)

- is your upload tmp folder set in php.ini?
- permissions to that folder?
- does the folder even exist?

---

<div class="post-metadata">

**Author:** ![avangeel](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/avangeel/32/205_2.png) [@avangeel](https://kanboard.discourse.group/u/avangeel)\
**Post date:** [June 7, 2019, 9:20am UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/6 "2019-06-07T09:20:31Z")

</div>

thx again for your reply, this is helping a lot to troubleshoot the issue.

The tmp folder for uploading files is not set:

 ![phptempsetting](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/1X/4a8cee738b15f53ed66e6310b4a8e29a009d7de6.png)  
assuming “upload\_tmp\_dir” is the correct setting.

And if I try to reproduce the error on the working test system that fails. In other words I set the upload\_tmp\_dir to a location where the webserver user has no rights. Still I can upload files. Guess this tmp settings has nothing to do with this issue.

Also I compared all the PHP settings of the working and non-working system. The only useful difference I see is the path environment setting of PHP. This isnt set in the non working system.

Any other suggestions?

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [June 7, 2019, 11:26am UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/7 "2019-06-07T11:26:13Z")

</div>

The thing is, error value 6.

Its telling you what the issue is. I promise it’s not lying. If it’s not set in php.ini, I think it just uses /temp on the base directory, and if you don’t have write access, error value 6.

---

<div class="post-metadata">

**Author:** ![avangeel](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/avangeel/32/205_2.png) [@avangeel](https://kanboard.discourse.group/u/avangeel)\
**Post date:** [June 7, 2019, 1:41pm UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/8 "2019-06-07T13:41:57Z")

</div>

Thx for narrowing this problem. I will look further into what tmp folder exactly it uses. I’ll give a notice when its finally solved.

---

<div class="post-metadata">

**Author:** ![avangeel](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/avangeel/32/205_2.png) [@avangeel](https://kanboard.discourse.group/u/avangeel)\
**Post date:** [June 7, 2019, 2:19pm UTC](https://kanboard.discourse.group/t/cant-attach-documents-to-a-task/424/9 "2019-06-07T14:19:48Z")

</div>

It’s clear for me now and I could reproduce the behavior.  
With the help of process monitor I could log the write actions. The following:

- if “upload\_tmp\_dir” in php.ini is not set the system will use the default tmp folder which is c:\windows\temp
- if “upload\_tmp\_dir” is set it will use this folder. But when the webserver has no right to this folder it uses the default tmp folder
- if both tmp folders are not writable I’ll get the permission error

I’m sure I can solve this now on the production system.

Thanks again for your help!
