How to upload image in custom module

How to upload image in custom module

by Kamal Joshi -
Number of replies: 2

HI!

I am learning how to create custom plugin(module) for moodle. and right now i am not clear how to upload images in that. Actually i am trying to create a module in which user can upload image using addElement('file') functionality.

Can anyone help me how to do it?

TIA

Kamal

Average of ratings: -
In reply to Kamal Joshi

How to upload image in custom module

by Kamal Joshi -

Hi,

In simple html form we are using <input type="file"> to browse perticular file and then we are using move_uploaded_file to upload that choosen file to server.

In the same way how we can browse file and upload it using moodleform_mod...

TIA

Regards

KAMAL

In reply to Kamal Joshi

How to upload image in custom module

by Kamal Joshi -

Hi,

Does anyone has idea, how to upload file and how to use it?

TIA

Regards

KAMAL