Topic: File_Column is not working

Hi,

I am using file_column to upload my files. I have also done validation for checking duplication file and duplicate name of the file. It is working fine. There is no problem with the code. But Many times in IE 6.0 when I try to upload after loggin to application first time I am getting "Page can not be displayed". And If I try it second time it is working fine.

Can anyone plz guide me, is it a bug with file_column or something else?

Code which I have written is as:

This is my controller

  def create
    @attachment = Attachment.new(params[:attachment])
    @claim = Claim.find_by_id(@attachment.claim_id)
    #@claim1 = Claim.
    @user_id = session[:user]
    @attachment.user_id = @user_id
    respond_to do |format|
      # Ensure the title and filename are unique
      if ( not @attachment.nil? ) and ( not @claim.nil? ) then
        title_check = Attachment.find_by_title( @attachment.title, :conditions => ['claim_id = ?',@claim.id] )
        if not title_check.nil? then
          flash[:error] = "The title '" + @attachment.title + "' is already in use."
          redirect_to edit_claim_path(@claim)
          return
        end
        if not @attachment.filename.nil? then
          file_check = Attachment.find_by_filename( File.basename( @attachment.filename ), :conditions => ['claim_id = ?',@claim.id] )
          if not file_check.nil? then
            flash[:error] = "This file is already attached to this claim."
            redirect_to edit_claim_path(@claim)         
            return
          end
        end 
      end
      if @attachment.save
        #claim.consultant_id = params[:claim][:consultant_id]
        email_list(@claim)
        flash[:notice] = 'Attachment was successfully created.'
        if @current_user.client?
          format.html { redirect_to claim_path(@claim) }
        else
          format.html { redirect_to edit_claim_path(@claim) }
        end
        format.xml  { head :created, :location => attachments_url }
      else
        format.html { render :action => "new" }
        #format.html  { redirect_to edit_claim_path(@claim) }
        format.xml  { render :xml => @attachment.errors.to_xml }
      end
    end
  end


In my model I have mentioned this thing:

file_column :filename
  #validates_filesize_of :filename, :in => 1.byte..1000.megabytes

  validates_presence_of :filename
  validates_presence_of :title

And this is my view:

    <tr>
        <th>File</th>
        <td><%= file_column_field "attachment", "filename", {:onclick => "document.getElementById('attachment_title').value = document.getElementById('attachment_filename').value"} %>
            <%= f.hidden_field :user_id, :value => @claim.user_id %>
            <%= f.hidden_field :claim_id, :value => @claim.id %>
        </td>
    </tr>
    <tr>
        <th>File Title</th>
        <td colspan="3"><%= f.text_field :title, {:id => "attachment_title"} %></td>
    </tr>

Thanks for help in advance