我如何在拉拉维尔获得上传的应用程序的可下载链接?我想将链接存储在 mysql 中。我使用curl上传应用程序。这是我的代码!
$headers = array("Content-Type: multipart/form-data");
$postfields = array(
"token" => 'IXWEsIpQBRUM4gSDu6f9aLB7W2AEPlsGb2kAJRVmRw',
"file" => new \CurlFile( $filename ),
"find_by_udid" => 0,
"wall_of_apps" => 1
// "callback_email" => ''
);
$ch = curl_init();
$options = array(
CURLOPT_URL => $url,
CURLOPT_HEADER => true,
CURLOPT_POST => 1,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $postfields,
CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36'
);
curl_setopt_array($ch, $options);
curl_exec($ch);
if(!curl_errno($ch))
{
$info = curl_getinfo($ch);
if ($info['http_code'] == 200)
$curl_error = "File uploaded successfully";
}
else
{
$curl_error = curl_error($ch);
}
curl_close($ch);
}
else
{
$curl_error = "Please select the file";
}
echo $curl_error;
红颜莎娜