I''m pretty new to ROR and working on a couple of small changes to an upload function, changing how the input spreadsheet is parsed. The problem is that the upload does not work on my Windows based development platform. It does work on MAc and Unix variants though. The logic is processing an uploaded spreadsheet file which is then processed/parsed by the ''spreadsheet'' gem. But on Windows the spreadsheet.open call fails with an error of "broken allocationtable chain". It appears that the file is corrupted as part of the upload when it is written to the temp file. There are comments on various Ruby pages about having to change the file open to binary, but I''m assuming this is the open buried in te Rails upload function. Has anyone come across this before? Any suggestions or ideas for a novice? Many thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Try using the File.open("myfile", "a"), also the rdocs for the io class describes the different types Sent from my iPhone On 7 Jan 2010, at 19:10, timjd <tim@traqfast.com> wrote:> I''m pretty new to ROR and working on a couple of small changes to an > upload function, changing how the input spreadsheet is parsed. > > The problem is that the upload does not work on my Windows based > development platform. It does work on MAc and Unix variants though. > > The logic is processing an uploaded spreadsheet file which is then > processed/parsed by the ''spreadsheet'' gem. But on Windows the > spreadsheet.open call fails with an error of "broken allocationtable > chain". It appears that the file is corrupted as part of the upload > when it is written to the temp file. > > There are comments on various Ruby pages about having to change the > file open to binary, but I''m assuming this is the open buried in te > Rails upload function. > > Has anyone come across this before? Any suggestions or ideas for a > novice? > > Many thanks > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails- > core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en > . > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Jan 7, 2010, at 2:10 PM, timjd wrote:> I''m pretty new to ROR and working on a couple of small changes to an > upload function, changing how the input spreadsheet is parsed. > > The problem is that the upload does not work on my Windows based > development platform. It does work on MAc and Unix variants though. > > The logic is processing an uploaded spreadsheet file which is then > processed/parsed by the ''spreadsheet'' gem. But on Windows the > spreadsheet.open call fails with an error of "broken allocationtable > chain". It appears that the file is corrupted as part of the upload > when it is written to the temp file. > There are comments on various Ruby pages about having to change the > file open to binary, but I''m assuming this is the open buried in te > Rails upload function. > > Has anyone come across this before? Any suggestions or ideas for a > novice? > > Many thanksFirst suggestion: this is a question for rails-talk, not rails-core. I''m sending this to the correct list... Secondly, I''d look at the version of ruby-ole on the Windows machine vs. the production machines, as that''s the function that appears to be giving the error. I''d also recommend manually opening the uploaded file in Excel to see if it''s actually corrupt. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.