2011/2/10 Juan RodrÃguez <jmrgjuan(a)gmail.com>om>:
There is a bug in my first message:
$uploadVars['url'] =
'http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png';
//$uploadVars['file'] = $fileContent;
You must not use both params. I proved but it isn't still working. I have
another problem: I installed LAMP and there is no support to curl by
default, so I might have to compile from source...
I still think that code must work with minimal modifications. I suspect the
problem is the wrapper: According with wikimedia doc, it must be a
multipart/form-data request, and I'm not sure if I'm doing the last step
correctly.
If you're using upload-by-url you need to have
$wgAllowCopyUploads=true and you're user needs to have the proper
userright (can't remember which one, look it up in the docs). You
don't need multipart/form-data for upload-by-url, only for regular
file uploads. Also, for regular file uploads, your file field needs to
be of the file-type, that is it requires the filename attributes and
perhaps some others.
Bryan