How to overwrite previously uploaded file with different extension.

Guys can any one help me for how to overwrite a file :

I have a fileupload on one interface from where i am uploading a file, and i have another interface from i want to upload the new version of the file.
I know how to overwrite the file if the same extension we are uploding by using the document id. Document is not getting overwrite, its creating new file in the selected folder. I dont want extension limit to upload.

E.g : on first interface i have upload .txt and when i am uploading final version of the same file i can upload any type of file e.g .txt, doc,xsd etc

OriginalPostID-249845

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi rahulk599,

    I would like to suggest another approach rather than deleting and uploading a new document with different extension try saving all the documents in a unique folder.
    And these document ids are saved to a database table along with a version number, a foreign key relationship id.
    You can add more columns depending on your need and then you need to make a small tweak in your sail interface where the target property of file upload component should point folder id instead of the document id as we are not overwriting the document technically.

    By following this approach you can save old version documents and you can retrieve them as per the version.
Reply
  • 0
    Certified Lead Developer
    Hi rahulk599,

    I would like to suggest another approach rather than deleting and uploading a new document with different extension try saving all the documents in a unique folder.
    And these document ids are saved to a database table along with a version number, a foreign key relationship id.
    You can add more columns depending on your need and then you need to make a small tweak in your sail interface where the target property of file upload component should point folder id instead of the document id as we are not overwriting the document technically.

    By following this approach you can save old version documents and you can retrieve them as per the version.
Children
No Data