型號..文件上傳與其他客戶端
def self.upload_client_document(params)
client_document = self.new :uploaded_data => params[:Filedata],:client_id => params[:client_id],:document_name => self.default_document_name,:document_description => self.default_description_name
client_document.rename_document_name
client_document.save!
# RAILS_ROOT + client_document.public_filename This will return path to file like
# C:/projects/test_project/client_documents/0000/0012/A100-bal.csv
RestClient.post 'http://demo.testltd.com/V12345/search.aspx?username=test1&password=test2',
:upload => File.new(RAILS_ROOT + client_document.public_filename)
end
得到錯誤errno的:: ENOENT(沒有這樣的文件或目錄 - C:/projects/test_project/client_documents/0000/0012/A100-bal.csv ):
但文件在那裏的文件夾...
任何想法?這段代碼有什麼問題? 任何我需要修改休息客戶端?