Link into server files/private files

This forum post has been removed

Number of replies: 4
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Link into server files/private files

by Stefan Nychka -

Hello.

Sometimes.  (More accurately, not exactly, but close.)

You don't normally, want to use links from the File Picker.  They won't work.  They'll link to the editor/File Picker, in essence, which isn't what you want.  And, of course, note exceptions like the URL resource and linking to the Legacy course files area where you use the File Picker to choose a file and produce an internal URL.

But, I have created a Folder, and when viewing it (so, not editing it), I was able to create a link from text on a Page.  It seems stable enough, although I haven't yet tried a backup and restore to see if the link stays intact.  I'm assuming it'll also work when you create a mini-site using a File resource, but I haven't tested the stability of a File's mini-site links from outside that File.

This may almost be a workaround to the link-once-update-many times problem.  You can't replace a file, but, at least within a Folder (and I believe within a File), you can delete a file named x, then replace it with another file named x (or, likely, upload a .zip containing the updated versions of the file or files with the same name/names, unzip, and the overwriting will be done)  After some testing, the link stays the same.

P.S. Note usually when I capitalized a word above, I was referring to a Moodle resource, as in File, as opposed to the generic def'n when I use file.

P.P.S I'm in a hurry, and if this sparks enough interest, I can explain it better ... please ask.

In reply to Stefan Nychka

Re: Link into server files/private files

by Derek Chirnside -

Stefan, just a little handwaving here on the repository/file picker, useability/power questions.  I'm really busy at the moment for a few days, but I am interested.

-Derek

One click upload: http://tracker.moodle.org/browse/MDL-19075 Sam, Martin, Don (etc) have all commented

Change once thread: http://moodle.org/mod/forum/discuss.php?d=174388 with proof of concept

'Link to file' option: somewhere.

Multiple file upload: somewhere.

All interconnected issues.  We need to keep a cool head here or we will undo the good things that Moodle 2.0 has to fix issues with Moodle 1.6. (Not to mention 1.9)  We also need to consider the coding guidelines etc.  And a new thing is emerging: people asking for a "spec".

I personally think there is a fragment of hope that some fixes may eventually get into core.  Won't be 2.1 sadly.

In reply to Derek Chirnside

Re: Link into server files/private files

by Stefan Nychka -

Hey.  Mainly letting you know I'm aware of your post, and I will better describe what I put in my previous post.  Not for at least a few days, though, maybe a week.

Also, to be clear, what I suggested was a workaround with the current version of Moodle.  You've included an improvement, which would be a better way of accomplishing this.  So they're related, but not the same.

Let me know if we are or are not on the same page; i.e., if I'm misunderstanding something, so you don't want me to post a better description.

Before I post again here, I'll more thoroughly read the tracker issue, and will perhaps try installing the improvement.  I'm pretty sure I'll end up voting for it, too, as at a glance it seems very useful.

Cheers

In reply to Stefan Nychka

Re: Link into server files/private files

by Stefan Nychka -

Sigh.

It doesn't work.  Links break across a restore.  So, I won't waste time describing things better.

Here's a brief description of the problem.

I do a a backup of courseA and restore to courseB.

There's a file a.txt in courseA in a Folder, folderA, that I'm linking to.
I link to it using a Label, labelA, and a URL, urlA.

After the restore, in courseB, I get an analogous Folder, Label and URL:  respectively, folderB (that contains an analogous a.txt), labelB and urlB.

The URLs in labelB and urlB unfortunately still refer back to folderA's a.txt, not folderB's a.txt.