ignisrzeus
5 months ago
935
15
Laravel

Storage::download does not download an existing file

Posted 5 months ago by ignisrzeus

Good day laracasts.

Below is my code for my download path:

    $headers = [
        'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        ];

        $cost_estimate = CostEstimate::findOrFail($id);
        return Storage::download("cost-estimates/".$cost_estimate->name, "trial.xlsx", $headers);

Case in point, I know for a fact that Storage recognizes that my file exist because it is not throwing an error that the file does not exist. The problem is, when I attempt to download a file using this function in the controller, I get a weird response of weird characters instead:

PK!¤SÅÏN[Content_Types].xml ¢( ¬“ËNÃ0E÷HüCä-ŠÝ²@5í‚Ǻ(`âIbÕ/yÜÒþ=÷±@¡j7±bÏÜs=3žÌ6Ökˆ¨½«Ø˜X®öJ»¶bŸ‹·ò‘˜¤SÒxÛ²Ùôöf²ØÀ‚²V¬K)<	uV"÷4>Z™è7¶"Èz)[÷£Ñƒ¨½KàR™z
6¼@#W&¯ÚÞ9‰`Ï»ÀžU1‚ѵLäT¬úE)÷N™9;ðŽl01HèOþìó>¨4Q+(æ2¦wiɆØñíãòËû%?-2àÒ7®Aùze©C©°HÖð¼r+µ;ø>ÁÏÁ(ò2¾²‘þ~YøŒDý‘¿—[È2g€˜¶ðÚeÏ¢§ÈÔ¯yôir#üŸ~Í>»$1i8çP“Dšú‹¯ý»R Ø"¿ãéÿÿPK!µU0#ôL_rels/.rels ¢( ¬’MOÃ0†ïHü‡È÷ÕݐBKwAH»!T~€Iܵ£$Ý¿'TƒG½~üÊÛÝ<êÈ!öâ4¬‹;#¶w­†—úqu*&r–Fq¬áÄvÕõÕö™GJy(v½*«¸¨¡KÉß#FÓñD±Ï.W	¥†=™ZÆMYÞbø®ÕBSí­†°·7 ê“Ï›ז¦é
?ˆ9LìҙÈsbgÙ®|Èl!õùUSh9i°bžr:"y_dlÀóD›¿ý|-NœÈR"4ø2ÏGÇ% õZ´4ñ˝yÄ7	ëÈðɂ‹¨ÞÿÿPK!%³ŽW+xl/workbook.xml¬U[o£8}_iÿâbsA¥£„‹¶ÒtTµÎK¥•¦x˜µM“ªšÿ¾Ÿ!¤ít´Êv6"¾s|Î÷›ÓO»¶1©Œw±‰OiЮà%ëbóëMn…¦!éJÒðŽÆæ•æ§³ß;Ýr±¹ç|[email protected]'c³Vªl[5m‰<á=í`¦â¢%
ºâÁ–½ ¤”5¥ªml¡Àn	ëÌ	!Ç`ðªbMy1´´Sˆ 
[email protected]_Ö¬—3Z[×±z«àm÷¬aêi5¶ˆÎ:.È}²wØ7vžþAáÌ;ÁÔ»­ZV.y¥NڞH¿Ó‘ñ›ìÞÇà8$Ïô‘éX‰àƒ¬‚Vð†Ñ/£a°Öè•‚÷A4ÿÀÍ1ÏN+ÖÐÛɺéû/¤Õ™jL£!Re%S´ŒÍtù–¾C¿X³Ž8žiŸì|)Œ’VdhÔ
y†‡“KÇ×+Á«FQÑEÞ)ðá^ׯznÄNj7®èßø´BIŠˆÜËK¢jcMl&ÑÝW	òïþâuWÜ¥Tnïï^ù’¼?ÿÁ™¤ÐrmÐ;qšÚ?jj"šÝw©„íóô3dàš<B> ëåþ¸žCÀÃ?Ÿlå¦i’Y‹Ës3ßZ;^h­Pè.Qæ/“Üù*DœªÞçXcƦçÿdê‚ì挢•/û?£ýÏÒõÅ<÷]+Õ·Ù-£[ùâÝ5vßXWòmlZØ5Oo»Ûqò+U
vB–LcPöPcŒq ½/Í,6Ÿ}”çYêbk„©å¥A-oe-² ôƒÔM쎌ìW”Æ{¨µÑ^¿Öw)†Z×:ºÐ‘ÞCœ—xÌÞüZAš¼­«qá#g©WНú,ÕXƒ­ÐÃZ-ÐÒ³Pæú–.+ô\ÇJ¼ÔÉüE–fk_çGßûÑÿqûîŽæŠfY¡n)6ðº¢ÕšHpÒ$ø¾&»öÃ5r¢—ãÜòðYëuàY~š»þƒÍüü…¬–_}ðî	íñmJÔçRɱé2ߏ«i`Ÿ§7‡.ºJuÜ÷oÿÛÂkPßÐ#ç·G.L¾\Ü\ŒÞø©{°.G[ØsZÎþÿÿPK!‡Úpà-xl/_rels/workbook.xml.rels ¢( ¬‘ËjÃ0E÷…þƒ˜}=v
¥”ÈٔB¶Åý!Ė„f’Ö_á‚Ý@H6Ù®Ýs$mw?ã N¹÷NC‘å ÈY_÷®ÕðU}<½‚b1®6ƒw¤a"†]ùø°ý¤ÁH:Ä]X¥Ç:‘ð†È¶£Ñpæ¹4i|¤[ÆLK¸ÉóŒÿ; <ëTûZCÜ×Ï ª)$òínß4½¥wo#9¹€@–iHP•‰-‰†¿œ%GÀËøÍ=ñ’ž…Vúq^‹kÅ=¾}<pG$«Ç²Å8O<ûäòÿÿPK!—9oƒØÖxl/worksheets/sheet1.xmlœ“ÉnÛ0†ïúï%yIlXR/hŠnwšI„¹¨$½¡è»g$CJ_Œ’0C‘ß?Cþ\<µ"Gp^Z“Ó4N(#l!M•Óß¿¶Ñ#%>pSpe
äôž>-?Zœ¬Ûû $ŸÓ:„fΘ5hîcۀÁ?¥ušL]Å|ã€Ý"­X–$S¦¹4ôJ˜»{¶,¥€µ
&\!X¿¯eã{š÷à4wûC	«D줒áÒA)ÑbþRëøNaßçtÌ9;|2|G½L7~£¤¥pÖÛ2ÄHfךo۟±ãb Ýö&3GÙà*ûXIéd`eo°ÑaÓÖn—›d‘Ó›éjšà'Ú<N¶Ñ8Ù~‰ž“Í:šŒÆãu6K§£íê?].
‰'ÜvE”9}N)[.:óü‘pòïbøî'(P ¥¤õæÎÚ};ñ‡ÄùnB‹ã"È#¬@)¤b›þïU kØ ð>îÕ¶›¿;[email protected]É*ü°§¯ «: ì{lM2/.kð݉Âq6Ê^óÀQ¡á|㮒Æe7ëwÅÆÁ6íÚDîlV÷Y÷Ð'IŒ;ZZú¤­|¸‘ËWÿÿPK!Á¾NÆ xl/theme/theme1.xmlìY͋7¿ú?swü5ã%ÞàÏl“Ý$d”µ¶ìQV32’¼%9õR(¤¥—Bo=”Ò@
½ô	$´éÑ'ÍØ#­å$›lJZv
‹Gþ½§§÷ž~zótñÒ½˜zG˜’–_¾Pò=œŒØ˜$Ӗk8(4|OH”Œe	nù,üK۟~rmÉÇØùDl¡–I9Û*ņ‘¸Àf8ß&ŒÇHÂ#ŸÇƒÞ˜+¥R­#’ø^‚bP{}2!#ì
•J{©¼Oá1‘B
Œ(ßWª±%¡±ãòBˆ…èRî!Úòaž1;â{Ò÷(~hù%ýç·/ÑV&DåYCn ÿ2¹L`|XÑsòéÁjÒ ƒZ{¥_¨\ÇõëýZ¿¶Ò§h4‚•¦¶Ø:ë•na
PúÕ¡»WïUËÞÐ_]³¹ª…× T°†ºàE¯A)>\ǝf§gë× _[Ã×Kí^P·ôkPDIr¸†.…µjw¹ÚdÂèŽÞƒA½’)ÏQ
«ìRSLX"7åZŒî2>€R$IâÉÅOв¸‹(9àÄÛ%Óo†&`¸T)
JUø¯>þ¦#Š¶02¤•]`‰XRöxbÄÉL¶ü+ Õ7 /ž={þðéó‡¿=ôèùÃ_²¹µ*Kn%SSîՏ_ÿýýÞ_¿þðêñ7éÔ'ñÂÄ¿üù˗¿ÿñ:õ°âÜ/¾}òòé“ß}õçOÚÛ˜ð!‰±ð®ácï&‹aûñ?Ä0BĒ@èv¨îËÈ^[ êÂu°íÂÛXƼ<¿kÙºñ¹$Ž™¯F±ÜcŒvw:ચËððpžLݓ󹉻‰Ð‘kî.J¬÷ç3 WâRٍ°eæ
Š‰¦8ÁÒS¿±CŒ«»Cˆå×=2âL°‰ôˆÓ%Cr`%R.´CbˆËÂe „ÚòÍÞm¯Ã¨kÕ=|d#a[ ê0~ˆ©åÆËh.QìR9D15¾‹dä2rÁG&®/$DzŠ)óúc,„Kæ:‡õA¿
ãû]Ä6’KrèÒ¹‹3‘=v؍P<sÚL’ÈÄ~&!E‘wƒI|Ù;D=CP²1Ü·	¶Âýf"¸äjš”'ˆúeα¼Œ™½t‚°‹eÚ<¶ØµÍ‰3;:ó©•Ú»StŒÆ{·>sXÐa3Ëç¹ÑW"`•ìJ¬+ÈÎUõœ`e’ªkÖ)r—+e÷ñ”m°goq‚x(‰ߤùDÝJ]8åœTzŽMà5åä‹Ó)×è0’»¿IëYg—zî|]p+~o³Ç`_Þ=í¾|j ö·öÍQk‚<a†
݂ˆþ\D«Zl؛6FV½“äÅω²'üwÊws[ñû”:›(eçD³	÷,kzhžÜÀp’¬sÖyUs^ÕøÿûªfÓ^>¯eÎk™óZÆõöõAj™¼|Ê&ïòèžO¼±å3!”îËÅ»Bw}¼ÑŒ0¨ÛQº'¹jÎ"øš5˜,ܔ#-ãq&?'2ڏÐZCeÝÀœŠLõTx3& c¤‡u+ŸÐ­ûNóxÓNg¹¬ºš©’ùx)\C—J¦èZ=ïÞ­Ôë~èTwY—(ÙÓaLfQuQ_B^g„^ٙXÑtXÑPꗡZFqå
0mxåöàE½å‡AÚA†f”çc§´™¼Œ®
ΙFz“3©™Pb/3 tSÙºqyjuiª½E¤-#Œt³0Ò0‚á,;͖ûYƺ™‡Ô2O¹b¹r3êkE"'¸&&SÐÄ;nùµj·*#4kùèÃ×x¹#Ô[¢S¸vIžnøwa–²‡D”:\“NÊ1‘˜{”Ä-_-•
4Ñ¢m+W€>Zãš@+›qt;Èx2Á#i†ÝQžNáS®pþªÅ߬$Ù½½:ç7¤XX/+Ž‰€‹ƒrêÍ1›°‘åùwâ`Êh×¼ŠÒ9”Ž#:‹Pv¢˜džÂ5‰®ÌÑO+OٚÁ¡ë.<˜ªö½OÝ7ÕÊsiæg¦Å*êÔt“é‡;ä
«òCÔ²*¥nýN-r®k.¹ÕyJ¼áÔ}‹Á0-ŸÌ2MY¼Nʳ³QÛ´3,OÔ6ømuF8=ñ®'?ȝÌ[email protected],ëJøúÊܼÕfw<zp8§RèPBo—#(úÒȔ6`‹Ü“Yß¼9'-ÿ~)lÝJØ-”a¿TƒR¡¶«…vVËý°\êu*à`‘Q\Óëú\aÐEvi¯Ç×.îãå-ͅ‹‹L_̵áúâ¾\Ù|qï ûµÊ Ymvj…fµ=(½N£ÐìÖ:…^­[ï
zÝ°Ñ<ð½#
ÚÕnPë7
µr·[j%e~£Y¨•J;¨·ý ý +c`å)}d¾÷j»¶ÿÿÿPK!y¡€l¤R
xl/styles.xml¤UmkÛ0þ>ØúîÊvã,	¶ËÒÔPèÆ ì«bˉ¨^Œ$gÎÆþûNv^:¶Ñ~‰NçÓsÏÝsRқN
´cÆr­2]…1UꊫM†¿>Á#먪¨ÐŠexÏ,¾Éß¿K­Ûö¸eÌ!€P6Ã[çš!¶Ü2Ií•n˜‚/µ6’:ؚ
±a´²þ$Ã)‘”+< ,dù? ’šç¶	J-êøšîö=F²\Üo”6t-€jMh‰ºhjbԙc’Þû"ä¥ÑV×î
p‰®k^²—tçdNhyFä×!E		ã‹Ú;óJ¤	1lǽ|8Ok­œE¥n•1¨oÁâYéïªðŸ¼sˆÊSûí¨O„Iž–ZhƒHë=ŠJ6DÜRÁ׆û°šJ.öƒ;öŽ^íCœäÐ{ï$žÇa±pˆqb{àÈSÏ1£
Ø ƒý´o ½‚I`ú¸DoÝGq2:@ú„yºÖ¦‚É>÷ãèÊSÁjD
ßlýêt¿kí¨Ÿ§§­¨ð¥ 'Ê)™~ú¿ÕØ]T+éî«Ã=òM8šPÈÁð†Ç£
Øo†E]}‰ˆ#Ú¤Oé‘×;ßýu09´n¹p\ý0`Vݹ¡WÀù«×7ç”:Q±š¶Â=>følboe|ŠúÂwÚõ>Û^©hês°Î=X/XQkx†Þ-?ÌWwEÌÂå,˜\³$˜'ËULn—«U1ãðö×èxÃõïß«<…‹µ°	s(öPâãٗáÑf ßÏ(ÐsŸÇÓðc…AqFÁdJgÁlzEÅ«édy—Ɉ{òÊg"$Q4<8ž|²pÁÕQ«£Bc/ˆÛ¿AŽJóŸAþÿÿPK!T¸N7>[docProps/core.xml ¢( Œ’ÍNÃ0„ïH¼Cä{b'¥XI*ê‰JH¸Yö6
Ä?²
iß'iCP9pôÎì·³+ç˽l¢/°®Öª@iBPŠkQ«ª@ϛU¼@‘óL	Öh:€CËòò"ç†rmáÑjÖ×à¢@RŽrS ÷†bìø$sIp¨ nµ•Ì‡§­°aüƒU€3BæX‚g‚y†;`lF":"‘æÓ[email protected]
HPÞá4Iñ×ƒ•îφ^™8eí&ìtŒ;e>ˆ£{ïêÑضmÒÎú!Š_×Oýªq­º[[email protected]å˜×¶|×;Ås<©t×k˜óëpèm
âöp2Ôp ¢…ÁOÊËìî~³BeF2“«˜d›”P2§³Å[7÷Wm(Èãôÿ¯iz3!žeŽÏ¾Cù
ÿÿPK!aI	‰docProps/app.xml ¢( œ’AoÛ0…ïúÝ9ÝP¬bHWô°a’¶gM¦c¡²$ˆ¬‘ì׏¶ÑÔÙzêä{xúDIÝ:_ôÑÅP‰å¢kö•xØÝ]~’	µñ[email protected]%Ž€âF_|R›dr€G¬DK”VR¢m¡3¸`9°ÒÄÜâ6ïelgá6ڗÉ«²¼–p 5ԗé(¦ÄUO
­£øðqwL¬Õ·”¼³†ø–ú§³9bl¨ø~°à•œ‹Šé¶`_²££.•œ·jk‡5ëÆx%ßêÌ°´qµêiՃ¥˜txmW¢ømœJô&;ˆ±ÛԌµOHY?ÅüŒ-¡’l˜†c9÷Îk÷E/GçÆ!`aáqçÈþj6&Ó;ÄË9ñÈ0ñN8ہo:sÎ7^™Oú'{»d‘…SõÅg|H»xk^×y>TÛÖd¨ùNë>
Ô=o2û!dݚ°‡úÕó¿0<þãôÃõòzQ~.ù]g3%ßþ²þÿÿPK-!¤SÅÏN[Content_Types].xmlPK-!µU0#ôL‡_rels/.relsPK-!%³ŽW+¬xl/workbook.xmlPK-!‡Úpà-0
xl/_rels/workbook.xml.relsPK-!—9oƒØÖPxl/worksheets/sheet1.xmlPK-!Á¾NÆ ^xl/theme/theme1.xmlPK-!y¡€l¤R
Ýxl/styles.xmlPK-!T¸N7>[¬docProps/core.xmlPK-!aI	‰!docProps/app.xmlPK		>à

Hence, my problem is not that my Storage is not locating my file, but rather, It's simply just not downloading my file at all. any suggestions on what to do? Thanks!

Please sign in or create an account to participate in this conversation.