上传文件的size经常结果为0,让人很费解
解决办法,attachment_fu.rb:
# about line 300
def uploaded_data=(file_data)
return nil if file_data.nil? || file_data.size == 0
self.content_type = file_data.content_type
self.filename = file_data.original_filename if respond_to?(:filename)
if file_data.is_a?(StringIO)
file_data.rewind
self.temp_data = file_data.read
else
self.temp_path = file_data
self.size = file_data.size
end
end
# about line 380
def set_size_from_temp_path
self.size = File.size(temp_path) if save_attachment? && self.size.nil?
end
分享到:
相关推荐
AT_Attachment_with_Packet_Interface_-_7_Volume_3
_storage_emulated_0_android_data_com.tencent.mm_MicroMsg_517174082dbc007f25c5bd836bdd4446_attachment_段润昌_648.wps
ATA接口的详细解读,working draft proposed American National Standard for Information Systems - ATA (ATAttachment) 78页
_storage_emulated_0_android_data_com.tencent.mm_MicroMsg_7cef220aad1703aed0c0f4bb62bea90d_attachment_1_实验四(1) .docx
个人博客:https://blog.csdn.net/MissXy_/article/details/83347968 参考使用;
Information Technology - AT Attachment with Packet Interface - 6 (ATA/ATAPI-6)ATA_ATAPI-6标准规范,驱动开发参考文档
用于LTE中下行物理链路中CRC添加的程序
生成四角、八角、十六角的方位标志。方便做图例。
very interesting matlab hev model
attachment_doc是一个SquirrelMail插件,允许用户使用其浏览器查看电子邮件中的文档附件。 该插件将文档转换为html格式。 目前支持MSWord(DOC)和可移植文档格式(PDF)!
西门子840d数控系统说明。对方的更多更好
Attachment_Project 附件项目
1649480820617212_attachment.cgi
attachment_repo 我要分享的一些文件
Salesforce附件移动器 ... 但是,如果您没有可访问的Salesforce ID,则还可以指定一个外部ID查找来插入附件记录。 看起来像这样: Account.External_Id__c 文件路径 12345abc test.html 您将需要修改uplo
This standard specifies the AT Attachment Interface between host systems and storage devices. It provides a common attachment interface for systems manufacturers, system integrators, software ...
Filament winding path generation
CREATE TABLE attachment ( attachment_id bigint(20)NOT NULL AUTO_INCREMENT, attachment_data longblob, attachment_name varchar(255)默认值, attachment_type varchar(255)默认值NULL,主键( ...
fdafdaafdasfdafdfdsafdadfdsafdsa
Stick-slip prevention