Project

General

Profile

Getting erro :1 file(s) could not be saved. - Where can I get detailed error logs any idea whats the issue

Added by saurabh agarwal over 14 years ago

Hi All,

I need your help in pinpointing the issue , I am getting the error "1 file(s) could not be saved." while attaching a file to the project , Where can i get detailed logs.

What I am doing is trying to put the files into the database instead of file system for this I had done the following steps.

1. For the time being I just changed the disk_filename field to varchar(25000) ( Just for the time being I will add a new blob filed subsequently ) .

2. Now I added some new code to file=
self.disk_filename = incoming_file.read

Now the function looks like :

def file=(incoming_file)
puts " Saurabh Inside file -======"
unless incoming_file.nil?
@temp_file = incoming_file
if @temp_file.size > 0
puts " Saurabh Inside file -====== if"
self.filename = sanitize_filename(@temp_file.original_filename)
#self.disk_filename = Attachment.disk_filename(filename)
#SAURABH change - Just changed this line , now geeting the above error.
self.disk_filename = incoming_file.read
self.content_type = @temp_file.content_type.to_s.chomp
self.filesize = @temp_file.size
puts " Saurabh Inside file -====== getting out of if"
end
end
end

Please help me in pinpointing the issue.

Thanks
Saurabh