ydakilux
(Ydakilux)
December 9, 2014, 7:42am
1
Hello,
I’m trying to use sendFile to open dwfx file (Autodesk Design Review file) but the file I get is corrupted.
If I compared with Winmerge the original file on the server and the received with the browser, there is an CRLF on the beginning of the file and 2 extra #0 #0 at the end.
I'm using the function in a action of a controller like this :
if (file_exists($filename)) {
return \Yii::$app->response->sendFile($filename, $shortname.'.'.$ext, ['mimeType' => "Content-Type: ".$mimetype]);
}
I have also tried :
\Yii::$app->response->sendFile($filename)->send();
I tried using <> Mimetype but the result is the same
$mimetype = "Content-type: application/x-Autodesk-DWF";
or
$mimeType = 'application/octet-stream';
Any help welcome.
amit5992
(Gupta5992amit)
December 30, 2014, 11:56am
2
ydakilux:
Hello,
I’m trying to use sendFile to open dwfx file (Autodesk Design Review file) but the file I get is corrupted.
If I compared with Winmerge the original file on the server and the received with the browser, there is an CRLF on the beginning of the file and 2 extra #0 #0 at the end.
I'm using the function in a action of a controller like this :
if (file_exists($filename)) {
return \Yii::$app->response->sendFile($filename, $shortname.'.'.$ext, ['mimeType' => "Content-Type: ".$mimetype]);
}
I have also tried :
\Yii::$app->response->sendFile($filename)->send();
I tried using <> Mimetype but the result is the same
$mimetype = "Content-type: application/x-Autodesk-DWF";
or
$mimeType = 'application/octet-stream';
Any help welcome.
you may use this:
\Yii::$app->response->sendContentAsFile($content, $filename, $mimeType);
vivek.aris
(Vivek Aris)
January 17, 2015, 7:20am
3
how to download file .if i uploded to fronend/web/upload.
any suggestion.