General developer forum

Download profile pictures

 
Picture of Marios Theo
Download profile pictures
 

Hello people i hope you are having a wonderful day.


I have a problem downloading profile pictures into my server.

All this time I've been using the script below which was working fine for moodle version 3.0.9


#!/bin/sh
curl -s -v -L -c "/tmp/cookiejar.txt"       \
	 -X POST                                \
	 --data-urlencode "username=myusername"    \
	 --data-urlencode "password=mypass"     \
	 --url "http://mysite.url/login/index.php"  
	 
curl -s -b "/tmp/cookiejar.txt"            \
     -X GET                                \
     -G                                    \
     --data-urlencode "rev=1"              \
     --data-urlencode "forcedownload=yes"  \
     --url "http://mysite.url/pluginfile.php/[userid]/user/icon/[theme]/f1" > folder/userPic.jpg


Unfortunately though for moodle version 3.3.2+ the script does not work and i couldn't figure out why.

Another thing that i want to ask is if there is any php function that could do the job instead of using shell scripts.


Thanking you in advance

Marios 



 
Average of ratings: -
Picture of Marios Theo
Re: Download profile pictures
 

Sorry people, In the end it was a mistake from my part. I switched platforms and i forgot to change the password for the new platform

Marios

 
Average of ratings: -
Me
Re: Download profile pictures
 
Is there a php alternative though?
 
Average of ratings: Useful (1)