0

New to Moodle, excuse me if this is silly question. I am trying to upload images to Moodle which can be accessible publicly. There's content bank but that generates links like this (https://example.com/draftfile.php/99556/user/draft/980392701/image.jpg) which I believe is not accessible for guest users.

Is there any plugin or other way which can give me URL like WordPress which I can hot link anywhere?

shyammakwana.me
  • 5,562
  • 2
  • 29
  • 50

1 Answers1

1

draftfile.php links are definitely not going to help you here. They are only accessible to the user who created them and will be deleted automatically after a few days (they are temporary links to be displayed within the text editor in a form, before the form data has been saved and a 'real' link can be generated).

You could try creating a course with guest access and enable automatic guest login for your site: https://docs.moodle.org/en/Guest_access

Once that is done, you could probably create a file (or folder) activity and put the files you want there. In theory, a user would still need to be logged in to access those files, but the login process should automatically allow them in as a guest. This should certainly work for directly clicking on a link to the relevant image, but I'm not sure how well it would work for images embedded in another site.

Ultimately, this isn't really what Moodle is designed for - it's designed for hosting courses and activities, not providing an image storage solution for other sites.

davosmith
  • 6,037
  • 2
  • 14
  • 23
  • Thanks for detailed answer, I understand it a little bit. My main issue was that I created a user and some content and images in a course, then deleted a user. then If I try to edit that same content images would not load. So I had to reupload all images. That's why I was looking for solution that's not tied to user in any way and all user can use / embed those images. – shyammakwana.me May 04 '22 at 07:48
  • If those files are deleted when the user account is deleted, then the files have not been properly stored within the Moodle Files API - once saved, they should no longer be linked to the user account that uploaded them. – davosmith May 04 '22 at 11:06