What can you do to repair the documents which have no filename when there is no upload button?
I've tried out how to add a file to documents module if the upload button is not available. Here my results. For step 2 you need access to the database:
1) copy the file to cache/upload directory on the sugar server. Rename the file to the 'document_revision_id' (from 'documents' database table) of the document object for which the file has to be attached. The new name will be '3f4a7d4a-3d42-f240-dca7-4dbfc7e0ccaf' for example.
2) Fill the needed parameters in 'document_revisions' table with this sql statement:
PHP Code:
update document_revisions
set filename='FILENAME_WITH.EXTENSION', file_ext='EXTENSION', file_mime_type='MIME_TYPE'
where id='THE_NEEDED_DOCUMENT_REVISION_ID' and revision=1
FILENAME_WITH.EXTENSION => the original filename (you can choose ANY aceptable filename here...)
EXTENSION => the extension of the file, e.g. 'doc', 'pdf', 'jpg' (should be the real one, otherwise you might not be able to open the file afterwards)
MIME_TYPE => depends on the mime type of the document, e.g. 'application/msword', 'application/pdf', 'image/jpeg' (the same as before)
THE_NEEDED_DOCUMENT_REVISION_ID => the value of the document_revision_id as described before, something like this: '3f4a7d4a-3d42-f240-dca7-4dbfc7e0ccaf'
revision => should be always '1' after a notes-import
When I perform these steps on my 6.2.0beta installation I can set the filename for the document without using the upload mechanism in sugar. I can open the file without problems then when clicking on the link in sugar documents module.
For a larger number of documents to import you'll have to look at a mechanism to automate the steps described here. Some ideas on that, e.g. using Talend, you can find here: http://www.sugarcrm.com/forums/showthread.php?t=35330.
Bookmarks