https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292011-07-29T10:50:43ZRedmineRedmine - Defect #8924: Problem with upload file (upload with size zero)https://www.redmine.org/issues/8924?journal_id=311462011-07-29T10:50:43ZEthan Fremen
<ul></ul><p>I have this problem as well, git head today.</p> Redmine - Defect #8924: Problem with upload file (upload with size zero)https://www.redmine.org/issues/8924?journal_id=311482011-07-29T11:25:49ZEthan Fremen
<ul></ul><p>So far I can confirm the file is uploaded correctly to the system /tmp dir .<br />The production log correctly references the /tmp/ filename in the "PUT".<br />The filename is created in /files but has 0 length.</p> Redmine - Defect #8924: Problem with upload file (upload with size zero)https://www.redmine.org/issues/8924?journal_id=311512011-07-29T12:18:53ZEthan Fremen
<ul></ul><p>Ok, I added a line to attachment.rb 's before_save to see what was going on. It appears that the file is written twice, and the second time it fails:</p>
<p>saving '/var/www/redmine/files/110729115834_logo.png'<br />wrote file of size 3479<br /> Attachment Create (0.4ms) INSERT INTO `attachments` (`disk_filename`, `content_type`, `downloads`, `created_on`, `container_id`, `container_type`, `digest`, `filename`, `filesize`, `author_id`, `description`) <abbr title="'110729115834_logo.png', 'image/png', 0, '2011-07-29 11:58:34', 504, 'Issue', 'ced4cf037c8efb68e8c1ab1719f6a18c', 'logo.png', 0, 3, ''">VALUES</abbr><br />saving '/var/www/redmine/files/110729115834_logo.png'<br />wrote file of size 0</p>
<p>When I back out the change to attachments.rb <a class="changeset" title="Fixed: MailHandler does not include JournalDetail for attached files (#7966)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/6312">r6312</a>:</p>
<p><a class="external" href="http://www.redmine.org/projects/redmine/repository/revisions/6312/diff/trunk/app/models/attachment.rb">http://www.redmine.org/projects/redmine/repository/revisions/6312/diff/trunk/app/models/attachment.rb</a> </p>
<pre><code>the file is correctly created, but still reports a 0 length file in the UI.</code></pre>
<p>That's as far as I can go to fixing this today.</p> Redmine - Defect #8924: Problem with upload file (upload with size zero)https://www.redmine.org/issues/8924?journal_id=311582011-07-29T15:32:54ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Resolution</strong> set to <i>Duplicate</i></li></ul><p>Same as <a class="issue tracker-1 status-5 priority-5 priority-high2 closed" title="Defect: File attachments 0-bytes after revision 6312 (Closed)" href="https://www.redmine.org/issues/8912">#8912</a> and fixed in <a class="changeset" title="Fixed: file uploads broken by r6312 (#8912)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/6320">r6320</a>. Thanks for digging into it.</p>