cancel
Showing results for 
Search instead for 
Did you mean: 

New version of document, different type

andyhorton
Champ in-the-making
Champ in-the-making
Hello,

I notice that if I have a document, say file.doc, when I press "Upload new version" I am only able to upload another .doc file. Now, this makes no sense to me. The point is that this is a document for humans, and it is secondary which application was used to create it. So, I might want to update a .doc with an .odt, or even a .docx. How can I enable this? Or to put it another way, how does one disable the "only update with document of the same type" feature?

Any ideas?

Regards

Andrew Horton
10 REPLIES 10

mrogers
Star Contributor
Star Contributor
There's nothing in the repo preventing this however it does result in badly named files which may upset some applications that are using patterns in file-names in lieu of storing a mimetype.   Until fairly recently it would have also upset some parts of alfresco such as indexing and thumnailing.   

If there's anything in share preventing this then its going to be fairly trivial to change.  (As opposed to something difficult and deep)

andyhorton
Champ in-the-making
Champ in-the-making
Thanks for your reply. I think however, I did not make myself clear in my question. The reason that the new file would have a different extension is that it would be a file of a different type. Let me try to make myself clearer.

I have a managed document, "Price LIst.doc". The document is currently a word document, a .doc file.

Someone is tasked with updating the price list. They feel that it should be a PDF - maybe they decide that it is easier to send PDFs to the print shop, so we should work in that format. So, a new price list is created.

At this point I think the document "Price List.doc" should be updated with "Upload new version", selecting and uploading the new version, "price List.pdf". The name would change, and the version would be updated.

I mean, why not? What do I care, the document is the document, isn't it? The file format, the details of which software created is technical. There is only one document, which has been through two versions.

Thumbnail and mime-type should not fall over, the .doc is a word document, the .pdf is a PDF. Simple.

Or is it? Is there no way to work like this? Do I have to delete the old .doc and upload a new PDF, thus losing the version history?

Andrew

mrogers
Star Contributor
Star Contributor
As I said above there's nothing in the repo preventing this.    It works.   Whatever is restricting your choice is
something fairly trivial.

What you should have is just a file called "price list".    Alfresco is fine with that, however word,  windows and adobe may be another matter.   If its a problem then just move or rename the file to be consistent with the new extension, that way all your external apps will be happy and you will still have all your metadata and version history.

andyhorton
Champ in-the-making
Champ in-the-making
Thanks again.

I think I am still not making myself clear. I just tried it all again to clear it in my mind, and hopefully make my explanation clearer 🙂

I uploaded a word doc "price list.doc". So now it is a document called "price list.doc"

I downloaded it to my desktop edited it, offline, and this time saved it as "price list.docx" on my desktop.

In Alfresco I went to the document "price list.doc" and chose "upload new version", the flash uploader appears , I press select files, a file open dialog appears.

In the "list files of type" control it says "files of same type as price list.doc" and it lists only the .doc files on my desktop. I cannot select and thus cannot upload the .docx file that I have created.

but I wish I could.

Andy

gmwestrup
Champ in-the-making
Champ in-the-making
Good point. I see what you mean as I have stumbled on the same issue. Also how can you manually change the version number?

andyhorton
Champ in-the-making
Champ in-the-making
*BUMP*

Anybody got any ideas?

soulpower
Champ in-the-making
Champ in-the-making
I'm facing the same issue.
Any idea?

Roberto

oskarelisson
Champ in-the-making
Champ in-the-making
Hi!

In the file flash-upload.js in /share/components/upload there is a filter beeing set. I just commented out the rows where the filter is beeing applied, and then you can upload any file type as a new version. Remember to also crete a new minified version of the modified flash-upload.js called flash-upload-min.js and replace that aswell.

Find this two rows and comment them out.

this.uploader.setFileFilters(obj.filter);
this.uploader.setFileFilters(this.showConfig.filter);

This works on Alfresco 4. Haven't tried it on earlier versions.

A prettier way of doing this is perhaps to not set the filter in document-actions.js in /share/components/document-details
Find the  FOLLOWING SECTION:

var singleUpdateConfig =
         {
            updateNodeRef: nodeRef.toString(),
            updateFilename: displayName,
            updateVersion: version,
            suppressRefreshEvent: true,
            overwrite: true,
            filter: [
            {
               description: description,
               extensions: extensions
            }],
            mode: this.fileUpload.MODE_SINGLE_UPDATE,
            onFileUploadComplete:
            {
               fn: this.onNewVersionUploadCompleteCustom,
               scope: this
            }
         };

If we set the filter here to empty it should work as well.

/Oskar

andyhorton
Champ in-the-making
Champ in-the-making
Oskar,

How would I set the filter to empty? Using [] or using [{}]?