$wgCacheSharedUploads = true;
/** Allow for upload to be copied from an URL. Requires Special:Upload?source=web */
$wgAllowCopyUploads = false;
+$wgCopyUploadTimeout = 30; // 30 seconds default timeout for upload-by-URL
+
/**
* Max size for uploads, in bytes. Currently only works for uploads from URL
* via CURL (see $wgAllowCopyUploads). The only way to impose limits on
* Returns true if there was an error, false otherwise
*/
private function curlCopy( $url, $dest ) {
- global $wgUser, $wgOut, $wgHTTPProxy;
+ global $wgUser, $wgOut, $wgHTTPProxy, $wgCopyUploadTimeout;
if( !$wgUser->isAllowed( 'upload_by_url' ) ) {
$wgOut->permissionRequired( 'upload_by_url' );
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTP_VERSION, 1.0); # Probably not needed, but apparently can work around some bug
- curl_setopt( $ch, CURLOPT_TIMEOUT, 10); # 10 seconds timeout
+ curl_setopt( $ch, CURLOPT_TIMEOUT, $wgCopyUploadTimeout); # Default 30 seconds timeout
curl_setopt( $ch, CURLOPT_LOW_SPEED_LIMIT, 512); # 0.5KB per second minimum transfer speed
curl_setopt( $ch, CURLOPT_URL, $url);
if( $wgHTTPProxy ) {