Defect #8924

Problem with upload file (upload with size zero)

Added by Rodrigo Guerrero almost 11 years ago. Updated almost 11 years ago.

Status:ClosedStart date:2011-07-27
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:Duplicate Affected version:


When I upload one file, upload without problem (show me ok and show me in the issue's page the file like if should upload ok).

But when I going to folder: "files" the file have size zero.

  • Redmine version: 1.2.1.devel.6316
  • Database version: MySql 5.0.51a-3ubuntu5.5
  • Ruby version: ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01
  • Rails version: rails-2.3.11

I don't have plugins install


Related issues

Duplicates Redmine - Defect #8912: File attachments 0-bytes after revision 6312 Closed 2011-07-27


#1 Updated by Ethan Fremen almost 11 years ago

I have this problem as well, git head today.

#2 Updated by Ethan Fremen almost 11 years ago

So far I can confirm the file is uploaded correctly to the system /tmp dir .
The production log correctly references the /tmp/ filename in the "PUT".
The filename is created in /files but has 0 length.

#3 Updated by Ethan Fremen almost 11 years ago

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:

saving '/var/www/redmine/files/110729115834_logo.png'
wrote file of size 3479
Attachment Create (0.4ms) INSERT INTO `attachments` (`disk_filename`, `content_type`, `downloads`, `created_on`, `container_id`, `container_type`, `digest`, `filename`, `filesize`, `author_id`, `description`) VALUES
saving '/var/www/redmine/files/110729115834_logo.png'
wrote file of size 0

When I back out the change to attachments.rb r6312:

the file is correctly created, but still reports a 0 length file in the UI.

That's as far as I can go to fixing this today.

#4 Updated by Jean-Philippe Lang almost 11 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Same as #8912 and fixed in r6320. Thanks for digging into it.

Also available in: Atom PDF