referencing uploaded files

referencing uploaded files

by Przemyslaw Stencel -
Number of replies: 7
I have uploaded 20 or so zip files to the Files area. Now I would like to make them available in a resource of the "html" type. How can I achieve this?

I used a link with href="http://moodle.site/file.php/courseid/path/to/file/filename.zip". Clicking on the link starts a download, but the file downloaded is only 1Kb and even though it has a zip extension it is in fact a text file containing <meta http-equiv='refresh' content='0; url=http://moodle.site/login/index.php'>.

Any help will be welcome.
Average of ratings: -
In reply to Przemyslaw Stencel

Re: referencing uploaded files

by Przemyslaw Stencel -
What is the best way to hyperlink to uploaded files from discussion messages, quiz questions, html resources, etc?
In reply to Przemyslaw Stencel

Re: referencing uploaded files

by Przemyslaw Stencel -
Judging by the number of responses, there are two possibilities:

A/ it is not possible to do it
or
B/ I've asked a moronic question wink

Just let me know, A or B? smile
In reply to Przemyslaw Stencel

Re: referencing uploaded files

by Douglas Greatorex -

If you are using the Richtext editor, just use the hyperlink tool (the chain icon).  You'll need to check the exact URL of the uploaded file you want first, as there's no menu from which to choose.  If you are not using Richtext, then you might have to put in the link yourself (unless your Moodle recognises the link and activates it automatically).  Use the code:

<A target=_new href="URL of your uploaded file">linked text</A>

Drop the target=_new if you don't want a new pop-up window.

Of course, you might not always be able to change the code, for instance in fora, but hope this helps anyway.

In reply to Douglas Greatorex

Re: referencing uploaded files

by Przemyslaw Stencel -
Thanks Douglas.

The thing I have problems with is the url. If I upload files somewhere outside Moodle, I can simply type the url of the file and that's it. But with the files which I have uploaded to Moodle (into the Files area) things are getting more complicated. The url I have to use will consist of the url of the site where moodle is installed, followed by the call to the file.php script, followed by the course id number, then followed by the path to the file and finally the filename itself. So, the url looks like this: http://moodle.site/file.php/courseid/path/to/file/filename.ext. Using this url works fine with html or image files, but if I try to use this technique with zip files, the url does not work.

Any ideas welcome.
In reply to Przemyslaw Stencel

Re: referencing uploaded files

by Scott Casley -

Just an idea... you did say any ideas...

The only way I can find is to use WIKI text resource type. Which is almost HTML smile

Your path above should work.

Scott

In reply to Scott Casley

Problem with uploaded zip files in Mozilla (Was: referencing uploaded files)

by Przemyslaw Stencel -
Thanks.

I know what was wrong. You're right - the path should work. And it works, but only in IE. In Mozilla, which is my primary browser, it works with image files, but now with zip files. I'm using Mozilla 1.3.

Could someone try to reproduce this situation and tell me if this problem also occurs for them?

Upload a zip file to the "Files" area of a course. Then add a resource of "html" type. In this resource, include a hyperlink to the uploaded zip file. The url should be along these lines:
http://moodle.site/file.php/courseidnumber/path/to/file/filename.zip

What happens in my case is that when using IE the zip file gets downloaded properly, but when using Mozilla, what is downloaded is a 'fake' zip file, which is in fact an html redirect page disguised with a zip extension.
In reply to Przemyslaw Stencel

Re: Problem with uploaded zip files in Mozilla (Was: referencing uploaded files)

by Hooi Ling Eng -

Prezemyslaw,

I reproduced the problem you are having with Mozilla 1.3.1 and the zip file was downloaded correctly. It also works well with IE. The only difference I've noticed is that Mozilla opens up a new browser if the uploaded file is in Word or Excel format.