{"action":"created","issue":{"url":"https://api.github.com/repos/danmunn/redmine_dmsf/issues/396","labels_url":"https://api.github.com/repos/danmunn/redmine_dmsf/issues/396/labels{/name}","comments_url":"https://api.github.com/repos/danmunn/redmine_dmsf/issues/396/comments","events_url":"https://api.github.com/repos/danmunn/redmine_dmsf/issues/396/events","html_url":"https://github.com/danmunn/redmine_dmsf/issues/396","id":90451028,"number":396,"title":"Error when uploading files","user":{"login":"Atmis","id":5329747,"avatar_url":"https://avatars.githubusercontent.com/u/5329747?v=3","gravatar_id":"","url":"https://api.github.com/users/Atmis","html_url":"https://github.com/Atmis","followers_url":"https://api.github.com/users/Atmis/followers","following_url":"https://api.github.com/users/Atmis/following{/other_user}","gists_url":"https://api.github.com/users/Atmis/gists{/gist_id}","starred_url":"https://api.github.com/users/Atmis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Atmis/subscriptions","organizations_url":"https://api.github.com/users/Atmis/orgs","repos_url":"https://api.github.com/users/Atmis/repos","events_url":"https://api.github.com/users/Atmis/events{/privacy}","received_events_url":"https://api.github.com/users/Atmis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/danmunn/redmine_dmsf/labels/type:%20bug","name":"type: bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"picman","id":779003,"avatar_url":"https://avatars.githubusercontent.com/u/779003?v=3","gravatar_id":"","url":"https://api.github.com/users/picman","html_url":"https://github.com/picman","followers_url":"https://api.github.com/users/picman/followers","following_url":"https://api.github.com/users/picman/following{/other_user}","gists_url":"https://api.github.com/users/picman/gists{/gist_id}","starred_url":"https://api.github.com/users/picman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/picman/subscriptions","organizations_url":"https://api.github.com/users/picman/orgs","repos_url":"https://api.github.com/users/picman/repos","events_url":"https://api.github.com/users/picman/events{/privacy}","received_events_url":"https://api.github.com/users/picman/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/danmunn/redmine_dmsf/milestones/12","html_url":"https://github.com/danmunn/redmine_dmsf/milestones/1.5.2","labels_url":"https://api.github.com/repos/danmunn/redmine_dmsf/milestones/12/labels","id":1049814,"number":12,"title":"1.5.2","description":"Redmine 3.x compatibility\r\nREST API\r\nLarge files upload optimization","creator":{"login":"picman","id":779003,"avatar_url":"https://avatars.githubusercontent.com/u/779003?v=3","gravatar_id":"","url":"https://api.github.com/users/picman","html_url":"https://github.com/picman","followers_url":"https://api.github.com/users/picman/followers","following_url":"https://api.github.com/users/picman/following{/other_user}","gists_url":"https://api.github.com/users/picman/gists{/gist_id}","starred_url":"https://api.github.com/users/picman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/picman/subscriptions","organizations_url":"https://api.github.com/users/picman/orgs","repos_url":"https://api.github.com/users/picman/repos","events_url":"https://api.github.com/users/picman/events{/privacy}","received_events_url":"https://api.github.com/users/picman/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":16,"state":"open","created_at":"2015-04-02T05:29:55Z","updated_at":"2015-06-24T07:09:02Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-06-23T17:54:52Z","updated_at":"2015-06-24T14:30:58Z","closed_at":null,"body":"Hi,\r\n\r\nI migrated this week-end our installation with Redmine trunk, and DMSF 1.5.2-devel (both downloaded last sunday).\r\nWe are not able to upload files anymore with JS, and we get the following message :\r\n![screenshot 2015-06-23 19_41_06 pma](https://cloud.githubusercontent.com/assets/5329747/8312986/450c9ede-19e0-11e5-9fdd-d4df71436836.png)\r\n\r\nIf we use the standard interface to drop files, then it works fine :\r\n![screenshot 2015-06-23 19_45_17 pma](https://cloud.githubusercontent.com/assets/5329747/8313013/71e3593e-19e0-11e5-9f9e-343ec477d285.png)\r\n\r\nWe are currently on a Windows Platform :\r\n```\r\nEnvironment:\r\n  Redmine version                3.0.3.devel\r\n  Ruby version                   2.0.0-p645 (2015-04-13) [x64-mingw32]\r\n  Rails version                  4.2.2\r\n  Environment                    production\r\n  Database adapter               PostgreSQL\r\nSCM:\r\n  Git                            1.9.5\r\n  Filesystem                     \r\nRedmine plugins:\r\n  clipboard_image_paste          1.10\r\n  redmine_checklists             3.1.1\r\n  redmine_contacts               4.0.1\r\n  redmine_csv_with_bom           0.0.2\r\n  redmine_dmsf                   1.5.2 devel\r\n  redmine_inline_note_images_plugin 0.0.1\r\n  redmine_landing_page           0.1.0\r\n  redmine_last_updated_by_column 0.3.0\r\n  redmine_lightbox2              0.2.2\r\n  redmine_local_avatars          0.2.0\r\n  redmine_mail_handler_clean_body_regexp 0.1\r\n  redmine_my_page_queries        2.1.6\r\n  redmine_silencer               0.4.0\r\n  redmine_stealth                0.6.0\r\n  sidebar_hide                   0.0.7\r\n```\r\n\r\nI investigated a little, and here is the Redmine log, at a debug level :\r\n```\r\nStarted POST \"/projects/test/dmsf/upload/file\" for 123.123.123.123 at 2015-06-23 19:18:30 +0200\r\nProcessing by DmsfUploadController#upload_file as */*\r\n  Parameters: {\"name\"=>\"Organisation 2015.pptx\", \"authenticity_token\"=>\"AZERTYUIOPQSDFGHJKLMWXCVBN1234567890\", \"file\"=>#<ActionDispatch::Http::UploadedFile:0x0000000648f098 @tempfile=#<Tempfile:C:/TEMP/RackMultipart20150623-4164-19bhq0o.pptx>, @original_filename=\"Organisation 2015.pptx\", @content_type=\"application/vnd.openxmlformats-officedocument.presentationml.presentation\", @headers=\"Content-Disposition: form-data; name=\\\"file\\\"; filename=\\\"Organisation 2015.pptx\\\"\\r\\nContent-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation\\r\\n\">, \"id\"=>\"test\"}\r\n  \u001B[1m\u001B[36m (0.0ms)\u001B[0m  \u001B[1mSELECT MAX(\"settings\".\"updated_on\") FROM \"settings\"\u001B[0m\r\n  \u001B[1m\u001B[35mUser Load (0.0ms)\u001B[0m  SELECT  \"users\".* FROM \"users\" WHERE \"users\".\"type\" IN ('User', 'AnonymousUser') AND \"users\".\"status\" = $1 AND \"users\".\"id\" = $2 LIMIT 1  [[\"status\", 1], [\"id\", 70]]\r\n  Current user: administrateur (id=70)\r\n  \u001B[1m\u001B[36m (0.0ms)\u001B[0m  \u001B[1mSELECT MAX(\"contacts_settings\".\"updated_on\") FROM \"contacts_settings\"\u001B[0m\r\n  \u001B[1m\u001B[35mProject Load (15.6ms)\u001B[0m  SELECT  \"projects\".* FROM \"projects\" WHERE \"projects\".\"identifier\" = $1 LIMIT 1  [[\"identifier\", \"test\"]]\r\n  \u001B[1m\u001B[36m (0.0ms)\u001B[0m  \u001B[1mSELECT \"enabled_modules\".\"name\" FROM \"enabled_modules\" WHERE \"enabled_modules\".\"project_id\" = $1\u001B[0m  [[\"project_id\", 1]]\r\nCompleted 500 Internal Server Error in 16ms (ActiveRecord: 15.6ms)\r\n\r\nErrno::EACCES (Permission denied - (C:/TEMP/RackMultipart20150623-4164-19bhq0o.pptx, C:/TEMP/150623191830_Organisation_2015.pptx)):\r\n  lib/redmine/sudo_mode.rb:63:in `sudo_mode'\r\n```\r\nIt seems that the file can't be renamed properly, and stays in the TEMP folder :\r\n![screenshot 2015-06-23 19_41_23 pma](https://cloud.githubusercontent.com/assets/5329747/8313116/0bbb5cb4-19e1-11e5-9ad0-16b790d49a71.png)\r\nOriginally, the path for the TMP folder was c:\\Windows\\TEMP, I changed it to C:\\TEMP (this is setup in an environment variable), and I doubled checked the authorization for that folder. It is all open.\r\n\r\nAny idea on a way to solve this ?"},"comment":{"url":"https://api.github.com/repos/danmunn/redmine_dmsf/issues/comments/114888350","html_url":"https://github.com/danmunn/redmine_dmsf/issues/396#issuecomment-114888350","issue_url":"https://api.github.com/repos/danmunn/redmine_dmsf/issues/396","id":114888350,"user":{"login":"picman","id":779003,"avatar_url":"https://avatars.githubusercontent.com/u/779003?v=3","gravatar_id":"","url":"https://api.github.com/users/picman","html_url":"https://github.com/picman","followers_url":"https://api.github.com/users/picman/followers","following_url":"https://api.github.com/users/picman/following{/other_user}","gists_url":"https://api.github.com/users/picman/gists{/gist_id}","starred_url":"https://api.github.com/users/picman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/picman/subscriptions","organizations_url":"https://api.github.com/users/picman/orgs","repos_url":"https://api.github.com/users/picman/repos","events_url":"https://api.github.com/users/picman/events{/privacy}","received_events_url":"https://api.github.com/users/picman/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T14:30:58Z","updated_at":"2015-06-24T14:30:58Z","body":"In short, yes.\n\n--\nKarel Pičman\n\nOn 24. 6. 2015, at 16:13, Atmis <notifications@github.com<mailto:notifications@github.com>> wrote:\n\n\nHi Karel,\n\nYou are always the best [:+1:]  I tried your fix and it works fine, thank you ! The file is renamed in the temp folder after upload, and deleted after the file is commited.\n\nI looked at your change, but I don't understand exactly what you did. Have you switch back to the old behavior (copy and delete ?)\n\nPierre\n\n—\nReply to this email directly or view it on GitHub<https://github.com/danmunn/redmine_dmsf/issues/396#issuecomment-114881281>.\n"}}