5
के साथ बल डाउनलोड फ़ाइल तो मैं लैरवेल 5 का उपयोग कर रहा हूं और मैंने एक चयनित फ़ाइल डाउनलोड करने के लिए मजबूर करने की कोशिश की लेकिन कुछ भी नहीं हुआ।लारवेल
public function downloadUserFile(){
$result = $_POST['filename'];
$entry = File::where('filename', $result)->firstOrFail();
$file = Storage::disk()->get($entry->filePath);
$headers = array('Content-Type' => $entry->mimetype);
return response()->download(storage_path($entry->filePath), $result, $headers);
}
और प्रतिक्रिया हेडर ठीक होने लगते हैं
Accept-Ranges: none
Cache-Control: public
Connection: Keep-Alive
Content-Disposition: attachment; filename="SIGNAL - Nadezdata.mp3"
Content-Length: 4205059
Content-Type: audio/mpeg
क्या आप जानते हैं कि क्या गलत है?
मैं पहले से ही यह बदल दिया है। लेकिन मैंने दृश्य में कुछ भी नहीं पारित किया है। क्या यह समस्या हो सकती है? – Alex
आपका क्या मतलब है? आप फ़ाइल को डाउनलोड करने के लिए सरल बल ब्राउज़र पर क्लिक करने के बाद, यहां किसी भी दृश्य का उपयोग नहीं करते हैं और यह –
है लेकिन कुछ भी नहीं होता है। कोई बल डाउनलोड नहीं है – Alex