{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/15030","labels_url":"https://api.github.com/repos/owncloud/core/issues/15030/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/15030/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/15030/events","html_url":"https://github.com/owncloud/core/issues/15030","id":62958656,"number":15030,"title":"Upload failed only on Webfrontend: Upload Max. 0 B - Not enough storage available","user":{"login":"DavidWiesner","id":243115,"avatar_url":"https://avatars.githubusercontent.com/u/243115?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidWiesner","html_url":"https://github.com/DavidWiesner","followers_url":"https://api.github.com/users/DavidWiesner/followers","following_url":"https://api.github.com/users/DavidWiesner/following{/other_user}","gists_url":"https://api.github.com/users/DavidWiesner/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidWiesner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidWiesner/subscriptions","organizations_url":"https://api.github.com/users/DavidWiesner/orgs","repos_url":"https://api.github.com/users/DavidWiesner/repos","events_url":"https://api.github.com/users/DavidWiesner/events{/privacy}","received_events_url":"https://api.github.com/users/DavidWiesner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","html_url":"https://github.com/owncloud/core/milestones/8.1-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-current","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":147,"closed_issues":1027,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-05-06T18:36:45Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"comments":2,"created_at":"2015-03-19T11:14:37Z","updated_at":"2015-05-06T18:49:23Z","closed_at":null,"body":"Hi,\r\n\r\nthanks for this great project!\r\n\r\nI have an issue uploading files on my Webfrontend, while its working with a sync client.\r\n\r\n### Steps to reproduce on some installations\r\n 1. There is enough free space on the disk (but owncloud can´t detect and will return `\\OCP\\Files\\FileInfo::SPACE_UNKNOWN`)\r\n 2. Tooltip next to the upload button says \"Upload Max. 0 B\". \r\n 3. If I try to upload a file anyway the file progressbar indicates that a file will be uploaded. \r\n 4. If the progessbar is on 100%, i got an error message \"Not enough storage available\".\r\n\r\n### Expected behaviour\r\nan upload shouldn´t fail if the freedisk space is unkown.\r\n\r\n### Actual behaviour\r\nthe upload failed\r\n\r\n### The Problem\r\nIn the end I figure out its seems a PHP problem on some systems. But owncloud should work anyway!\r\n\r\nThe root of the evil is `INF == 0` on some installations. Here is the bugreport https://bugs.php.net/bug.php?id=69188 \r\n \r\nSince you are using INF in `freeSpace()` in [`lib/private/helpers.php#L824`](https://github.com/owncloud/core/blob/06aef4e8b1f2086971c62b064f810e24785fb215/lib/private/helper.php#L824)\r\n\r\n`maxUploadFilesize()` using the result of `freeSpace()` in a `min()` function (see: [lib/private/helper.php#L815](https://github.com/owncloud/core/blob/06aef4e8b1f2086971c62b064f810e24785fb215/lib/private/helper.php#L815) ). So `maxUploadFilesize()` will always return 0.\r\n\r\nIn the end the fileupload will be canceled  by a if-statement in [apps/files/ajax/upload.php#L108](https://github.com/owncloud/core/blob/06aef4e8b1f2086971c62b064f810e24785fb215/apps/files/ajax/upload.php#L108)\r\n\r\n### Possible Fix\r\n\r\nUsing `PHP_INT_MAX` instead of `INF` in my `lib/private/helpers.php` fixed the problem on my installation. \r\n```\r\n--- old/helper.php\t2015-03-19 12:13:30.818505473 +0100\r\n+++ new/helper.php\t2015-03-19 12:11:21.924501375 +0100\r\n@@ -831,7 +831,7 @@\r\n \t\t\t$freeSpace = max($freeSpace, 0);\r\n \t\t\treturn $freeSpace;\r\n \t\t} else {\r\n-\t\t\treturn INF;\r\n+\t\t\treturn PHP_INT_MAX;\r\n \t\t}\r\n \t}\r\n```\r\nregards,\r\nDavid\r\n\r\n### Server configuration\r\n**Operating system**:\r\nSunOS  5.10  i86pc\r\n**Web server:**\r\nApache/2.2.29\r\n**Database:**\r\nMySQL 5.0.96\r\n**PHP version:**\r\n5.6.6\r\n**ownCloud version:** (see ownCloud admin page)\r\n8.0.2 (same problem in 8.0, 7.0.5)\r\n**Updated from an older ownCloud or fresh install:**\r\nupdated\r\n**List of activated apps:**\r\nfiles, pictures, calendar, contacts\r\n**The content of config/config.php:**\r\n```\r\n<?php\r\n$CONFIG = array (\r\n  'instanceid' => /*...*/,\r\n  'passwordsalt' => /*...*/,\r\n  'datadirectory' => /*...*/,\r\n  'dbtype' => 'mysql',\r\n  'version' => '8.0.2.0',\r\n  'dbname' => /*...*/,\r\n  'dbhost' => /*...*/,\r\n  'dbtableprefix' => /*...*/,\r\n  'dbuser' => /*...*/,\r\n  'dbpassword' => /*...*/,\r\n  'installed' => true,\r\n  'maintenance' => false,\r\n  'theme' => '',\r\n  'loglevel' => '0',\r\n  'trusted_domains' => \r\n  array (/*...*/\r\n  ),\r\n  'secret' => /*...*/,\r\n  'share_folder' => '/Shared',\r\n);\r\n```\r\n\r\n**Are you using external storage, if yes which one:** local/smb/sftp/...\r\nlocal\r\n**Are you using encryption:** yes/no\r\nno\r\n**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...\r\nno\r\n### Client configuration\r\n**Browser:**\r\nChrome/Firefox/Opera\r\n**Operating system:**\r\nLinux\r\n### Logs\r\nno corresponding logs found"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/99571352","html_url":"https://github.com/owncloud/core/issues/15030#issuecomment-99571352","issue_url":"https://api.github.com/repos/owncloud/core/issues/15030","id":99571352,"user":{"login":"karlitschek","id":867445,"avatar_url":"https://avatars.githubusercontent.com/u/867445?v=3","gravatar_id":"","url":"https://api.github.com/users/karlitschek","html_url":"https://github.com/karlitschek","followers_url":"https://api.github.com/users/karlitschek/followers","following_url":"https://api.github.com/users/karlitschek/following{/other_user}","gists_url":"https://api.github.com/users/karlitschek/gists{/gist_id}","starred_url":"https://api.github.com/users/karlitschek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlitschek/subscriptions","organizations_url":"https://api.github.com/users/karlitschek/orgs","repos_url":"https://api.github.com/users/karlitschek/repos","events_url":"https://api.github.com/users/karlitschek/events{/privacy}","received_events_url":"https://api.github.com/users/karlitschek/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T18:49:23Z","updated_at":"2015-05-06T18:49:23Z","body":"@icewind1991 @DeepDiver1975 What is the status here?"}}