[7.0]DMS : downloading attachment fails

Bug #1131272 reported by Houssine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

OpenERP version : 7.0
OS : Windows

Hi,

We have configured the DMS to store the attachments on the filesystem

We are encouring error while we try to download a file previously attachment to a document.

The downloaded file can't be opened and the size of the file is less than 1k.

You can reproduce this with a new fresh database with demo data. Install the DMS

Configure the dms to store the file on the filesystem. attach a file to a object(sales order or anything else)

then try to download it.

Note that in some cases we have error trying to attach a file to the object.

This functionnality is clearly unconsistent on windows.

We don't encoure the error when the dms store the attachment in the database.

Thanks for you help

Kind regards,
Houssine

Revision history for this message
Antony Lesuisse (OpenERP) (al-openerp) wrote :

I fixed the attachment download in 4860 revid:<email address hidden>

affects: openobject-addons → openobject-server
Changed in openobject-server:
importance: Undecided → Medium
status: New → Fix Released
Revision history for this message
Houssine (houssine-bakkali) wrote :
Download full text (5.0 KiB)

Thanks it solved the problem for txt file

I have thi s stacktrache uploading an odt and xls files but the files are well uploaded anyway

2013-02-28 12:30:22,140 4844 INFO DMS werkzeug: 127.0.0.1 - - [28/Feb/2013 12:30:22] "GET /web/binary/saveas?model=ir.attachment&field=datas&filename_field=name&session_id=97b92a26d351477d94bb78239ab33bf1&id=6&t=1362050916754 HTTP/1.1" 200 -
2013-02-28 12:30:47,375 4844 ERROR DMS openerp.addons.document.content_index: Cannot determine mime type.
Traceback (most recent call last):
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\addons\document\content_index.py", line 167, in doIndex
    pop = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE)
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
2013-02-28 12:30:47,515 4844 INFO DMS werkzeug: 127.0.0.1 - - [28/Feb/2013 12:30:47] "POST /web/binary/upload_attachment HTTP/1.1" 200 -
2013-02-28 12:30:47,592 4844 INFO DMS werkzeug: 127.0.0.1 - - [28/Feb/2013 12:30:47] "POST /web/dataset/search_read HTTP/1.1" 200 -

but it doesn't work with pdf file i got infinite loading screen and the following stacktrace :

2013-02-28 12:33:56,562 4844 ERROR DMS openerp.addons.document.content_index: Cannot index file Start Point Of Sale - OpenERP.pdf (None).
Traceback (most recent call last):
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\addons\document\content_index.py", line 181, in doIndex
    res = (mime, fobj.indexContent(content,filename,fname or realfname) )
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\addons\document\content_index.py", line 90, in indexContent
    res = self._doIndexFile(rfname)
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\addons\document\std_index.py", line 169, in _doIndexFile
    pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', "'"+ fname+"'", '-'], shell=False, stdout=PIPE)
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
2013-02-28 12:33:56,562 4844 ERROR DMS openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\osv\osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\osv\osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\osv\osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\openerp\addons\document\document.py", line 121, in create
    vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
  File "C:\workspace_OpenERP\openerp_server_7_0_20130131\opener...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.