File manager upload rename problem

Bugs » #13


This section on the Community is no longer supported, in favour of Wikidot's Official Feedback Site .

It is retained here for archiving purposes.

Posted by Phil Chett Phil Chett on 07 Jun 2008 10:47, last edited on 04 Mar 2009 09:35

This bug is open

Description

Simply put, when uploading a file to replace a pre-existing one of the same name, in most cases the file is not overwritten.

This is a cache issue in the Wikidot engine. Files are first uploaded to the Wikidot file server, and when first accessed/viewed, they are copied to the Wikidot cache, and accessed from there.
When files are deleted, they are removed from the Wikidot file server, and then removed from the Wikidot cache at a later date. This means that whilst you have deleted a file from the server, it can potentially continue to be accessed.
Similarly, this is also the case when files are overwritten. Files are overwritten on the Wikidot server, but are not removed from the Wikidot cache. So when you overwrite a file and go to access it, the old version of the file will be accessed instead of the new one.
Files are only transfered to the Wikidot cache the first time they are accessed. So if you upload a file and delete or overwrite it before it is first accessed, then the new/updated file will be transfered to the Wikidot cache, and no problems will arise.

If files were deleted from the cache as soon as they are overwritten, renamed or deleted from the Wikidot file server, this problem would cease to exist.

First reported by hessb hessb in this post

How to reproduce

There are two ways to reproduce this error.

The first way involves deleting the file:

  1. Upload a file with a given name (i.e. test.txt);
  2. Open/View the uploaded file;
  3. Delete it;
  4. Upload a different file with the same given name;
  5. Open/View the new uploaded file.

The second way involves overwriting the file:

  1. Upload a file with a given name (i.e. test.txt);
  2. Open/View the uploaded file;
  3. Upload a different file with the same given name;
  4. Click "overwrite" on the message box that pops up (it is asking you if you want to overwrite an existing file);
  5. Open/View the new uploaded file.

On opening the file for a second time, the first version is displayed, NOT the second one

Browsers

All

Workarounds?

None — you must give the new file a new name.

Rate this Bug

Rate the urgency of this bug. If you think it is more urgent and important than it's current rating suggests, rate it up.

rating: +5
Workaround!
GoVegan GoVegan 02 Jul 2008 01:49

I have a workaround, although, inconvenient, it works.

If you want to upload a file to replace a previously existing one, follow these instructions:

  1. Click on the "files" button in the bottom right-hand corner;
  2. Click on the "options" link of the file you want to delete;
  3. Select the "move" link;
  4. Move it to a different page, I suggest to the "deleted" category/page;
  5. Upload the file which will replace the pre-existing one;
  6. Go to the page you moved the pre-existing file to, and delete it permanently from there.

How it works? I believe that when a file is renamed, it is simply copied with a new name, but the Wikidot engine 'forgets' to delete the existing file. I also believe that when you delete a file permanently, that the Wikidot engine puts that file in the que for permanent deletion, and so it is yet to be deleted. Until it is deleted, you can not upload files of the same name on that particular page.

When you move a file to a different page, Wikidot doesn't go through the whole "copy" process; it simply and literally "moves" the file to a different page. Thus, the original page no longer has the file, or any reminiscence of it, and you can upload files to replace the pre-existing one — without any interference or problems.

Cheers ~ James Kanjo

by GoVegan GoVegan , 02 Jul 2008 01:49
Re: Workaround!
GoVegan GoVegan 26 Aug 2008 07:57

This technique no longer works for some strange reason (I used to do it all the time).

by GoVegan GoVegan , 26 Aug 2008 07:57
Cache?
Gabrys Gabrys 25 Jul 2008 21:18

Hey, this could be basically a cache issue. Try to do the following:

a) upload file
b) DON'T view the uploaded file (not trigger caching yet)
c) upload a different file under the same name
d) try to view the uploaded file

If you get the NEW content (from c) ), it's cache issue (and we have some nice idea here), if not, this really is a bug.


Piotr Gabryjeluk
visit my blog

by Gabrys Gabrys , 25 Jul 2008 21:18
Re: Cache?
GoVegan GoVegan 30 Jul 2008 08:15

Since a lot of people are lazy, and you came up with the idea, why don't you test it?

by GoVegan GoVegan , 30 Jul 2008 08:15
Re: Cache?
(account deleted) 14 Aug 2008 03:32

I have run into this before. it is definitely a cache issue. I have a document repository on my wiki at work and I run into this regularly when uploading an updated document to replace an older version. My users have to clear their cache before accessing the updated file if they had recently accessed the older file.

-Ed

by (account deleted), 14 Aug 2008 03:32
Re: Cache?
RobElliott RobElliott 14 Aug 2008 07:03

We get round this by stating in our wiki instructions that new versions of a document are never saved with the same name but that the date and initials should appended to the file name and the new version saved and linked to on the page. This allows you to see previous versions and the build up of the document over time which is in the spirit of wikis.

Overall though I try to encourage my users not to use files where possible but to write/change the text directly into the editor. Only when we are near completion and are looking at layout of text, tables and images is it copied into Word.

Rob


Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.

by RobElliott RobElliott , 14 Aug 2008 07:03
Re: Cache?
GoVegan GoVegan 26 Aug 2008 07:38

Since it's been a month and nobody has done the test, I did it.

I performed TWO tests, the first one being Gabrys one:

1) Uploaded a file;
2) DIDN'T view the uploaded file (not trigger caching yet);
3) Uploaded a different file under the same name. I got a popup message asking me to overwrite and I selected 'yes';
4) Tried to view the uploaded file.

The result from this test was that I got the new file that had overwritten the old one.

Just to make sure, I performed a second test (typically the 'control' test):

1) Uploaded a file;
2) DID view the uploaded file (trigger caching);
3) Uploaded a different file under the same name. I got a popup message asking me to overwrite and I selected 'yes';
4) Tried to view the uploaded file.

The result from this test was that I got the old file that the new file had supposedly 'overwritten', and obviously has not been.

So, now we have confirmation: THIS IS DEFINITELY A CACHE ISSUE

Cheers ~ James Kanjo

by GoVegan GoVegan , 26 Aug 2008 07:38
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.

AltStyle によって変換されたページ (->オリジナル) /