Link to shared file broken after changing the file locally

Hello Community,

I got a local PDF file in a local Windows folder which is synchronized via ownCloud to an address like
https://box-xy.mycompany.com.

I have shared the file through a link similar to
https://box-xy.mycompany.com/index.php/s/1ABCXyJklVWaBCb

Now I’ve just made some changes locally to the PDF file, and find that after it has uploaded to ownCloud, the file has no longer “shared” status, so that the original link I had distributed to a large international team no longer works.

Unfortunately, this is a medium-sized disaster problem for the project.

Why is that so, can I repair it (especially reassign the last distributed link to the file again) – or how can this be prevented from happening in the future?

Thanks
David

I’m afraid I couldn’t reproduce your issue, for me a link was still working after changing a document, I might, however, help you with recovering the share:

Connect to your owncloud database and find out, which fileid the new document has got, eg:

SELECT * FROM oc_filecache WHERE name = '<yourfilename_here>';

Choose the fileid from the result which matches your path.
Now you can replace the linked item with the following query:

UPDATE oc_share SET item_source=<fileid>, file_source=<fileid> WHERE token='<yourtoken>';

Replace your token with the last string in the link, like 1ABCXyJklVWaBCb in the example you provided.

From then on the new document is reached with the old link.

In any case, next time you might share a folder, even when there is only a single file in it, so you can change its contents at your will.

Thanks Cortho for your reply.

The reason could have been that I have assigned an expiration date to the file.

I am however afraid that your instructions go over my head. Can I do any of this (e.g. connect to owncloud database, replace linked item etc.) as a mere ownCloud user ?

Thanks also for the idea of sharing a folder instead. Will do so next time!

David,

Unfortunately those DB commands are only available, when you have got direct access to the database. Since your setup was not clear, I assumed you might be hosting your own environment. So in your case this is not applicable.

Could be, but it seems like we’ll never find out …

I hope your document will reach all the recipients nevertheless.

Thanks again cortho,

well, I shall try and re-distribute a new link then.

Let’s see, maybe there is even some unexpected positive side effect in that broken first link.

Cheers
David

Hey,

it seems you have omitted all information about your issue and environment (e.g. used ownCloud version) asked in the issue template showing up when creating a new thread. Maybe this unexpected behavior is also originating from using an outdated version of the server or client?