Hope all is well. I tried implementing this with a CSV file instead but when the csv is downloaded, the HTML code is also printed. Anyone knows how to resolve this?
@ashishsoni24315 жыл бұрын
Really you are awesome bro......i appreciate it....😉
@CodeFlix125 жыл бұрын
I do everything for you all people who need solutions to problems easily. Thanks for always supporting and commenting! Appreciate a lot!
@Sumonms3 жыл бұрын
it show "we don;t support this file format"
@CodeFlix123 жыл бұрын
Which file format?
@Sumonms3 жыл бұрын
@@CodeFlix12 dear sir when download is complete the image i can't show its blank white
@CodeFlix123 жыл бұрын
I am not getting it
@misnad4 жыл бұрын
When I tried it, it is downloading the download.php file, and not image .. plz help ☹️
@CodeFlix124 жыл бұрын
Put anchor tag on image
@srinivasanks2988 Жыл бұрын
A doubt,its work,without downloading image,i've tried downloading the php program file,but after downloading the notepad file, after i open, show a my wrote html file also, how to do it
@natnatmaglalang84725 жыл бұрын
thank u a lot, your tutorials are so helpfull. and some tutorial about file management please , thank u a lot
@CodeFlix125 жыл бұрын
Yes i have made tutorials on file management you can check.. they are old.. if other than that u want any specific topic tutorial than u can comment here or mail me. Thanks❤️
@natnatmaglalang84725 жыл бұрын
ah yess im already downloaded your tutorials about file managemet, can I ask, ,about sending files through gmal , because my thesis is about files management
@CodeFlix125 жыл бұрын
Yes I will try to built something like that! Currently I am working on another topic of file management. Hope that helps. Keep flixing 🙌
@natnatmaglalang84725 жыл бұрын
thank a lot , more powers to come😊
@mabasadailycode17813 жыл бұрын
Thank you 🕺, but how do I set the content disposition if my file name contains special characters like &, + because I can’t download them though other files I’m able to. I would appreciate if you could help. Thank you 🙏
@CodeFlix123 жыл бұрын
Try escape characters
@hwy4193 жыл бұрын
Very helpful. Thank you!
@CodeFlix123 жыл бұрын
♥️♥️
@samarthd.n.23143 жыл бұрын
I know this video is outdated, but can you make a video on allowing to upload and download files of all sizes and types in php
@CodeFlix123 жыл бұрын
It is not outdated sir, it still works. I already have a video on upload which works too
@____Boss_____2 жыл бұрын
@@CodeFlix12 No need of this much codes just a download attribute is enough
@srinivasan0003 жыл бұрын
download Download attribute html
@CodeFlix123 жыл бұрын
♥️♥️
@hritwikadubey39642 жыл бұрын
what if I want to download the file in specific folder like "downloads"?
@rendyaditama38153 жыл бұрын
Very good tutorial, but the files that can be downloaded are only photos. document files such as (.pdf) and also compressed files such as (.rar) cannot be downloaded. can you tell me how to download (.rar) and (.pdf) files using php?
@CodeFlix123 жыл бұрын
Try adding allowable extensions
@rendyaditama38153 жыл бұрын
@@CodeFlix12 how to add allowable extensions?
@CodeFlix123 жыл бұрын
You can see it in the code
@poojabhatia2474 жыл бұрын
The source code gave me an Warning: Cannot modify header information - headers already sent, please could you help me resolving this error. Thank You!
@CodeFlix124 жыл бұрын
Did you use different headers than what are used in the code? Also, you mentioned warning, so is the code still running for you?
@julsco87014 жыл бұрын
why i cant download my file? when i click the tag was always display a word in a different language? help me please for my capstone project. Godbless.
@CodeFlix124 жыл бұрын
Can you mail me screenshots! I might understand your problem in a more better way then. It is working fine for others including me so
@julsco87014 жыл бұрын
@@CodeFlix12 it wont work in cpanel. or it already upped.
@julsco87014 жыл бұрын
@@CodeFlix12 But it works in localhost. What's the problem with that?
@CodeFlix124 жыл бұрын
The problem is with the path given for the file in the cpanel then
@moesatt41454 жыл бұрын
This is a very helpful video. Can you please also help me do a tutorial "after the users key in their id (eg 001), users can download the files that I uploaded in the database according to the id" Thank you very much in advnace! :)
@CodeFlix124 жыл бұрын
Thank you
@hmonmoesatt70924 жыл бұрын
CodeFlix do u have any suggestions for the tutorial I mentioned? Is it possible to do that?
@CodeFlix124 жыл бұрын
@@hmonmoesatt7092 hey! I dont think brother exposing the ID to end users is a good idea, it is possible but harmful
@moesatt41454 жыл бұрын
in this case, what I mean by ID is just a unique number for them to get their own files ( I want my customers to download their files themselves instead of email to them) :D
@kabir0x234 жыл бұрын
it will really help me , thanks dude
@CodeFlix124 жыл бұрын
❤️❤️
@kabir0x234 жыл бұрын
@@CodeFlix12 😊
@nadaah93 жыл бұрын
Thank you so much for the concise video and explanation of how the codes work THANK YOU SO MUCH
@CodeFlix123 жыл бұрын
♥️♥️
@ilhamfirnanda94824 жыл бұрын
may i ask how to handle if file is cancel download and do something
@CodeFlix124 жыл бұрын
You can make a handleCancel function which works on click of cancel button
@ilhamfirnanda94824 жыл бұрын
@@CodeFlix12 can you make example please
@CodeFlix124 жыл бұрын
@@ilhamfirnanda9482 brother we just need to add a function for on cancel click
@designmaster212 жыл бұрын
Thanks Sir ❤ You help me a lot 😍 May Allah Bless you Ameen
@CodeFlix122 жыл бұрын
❤️❤️
@ShubhamPandey-st4nn3 жыл бұрын
very helpful. thanks a lot
@CodeFlix123 жыл бұрын
♥️♥️
@yudhawibowo7773 жыл бұрын
Thanks before for your video , but any little error after download file , as shown the file its can't be open with message : error format. and I have solutions for this , and bellow its my code and really working fine : $filename = basename($_GET['path']); $filepath = './assets/file/berkas/' .$filename; if(!empty($filename) && file_exists($filepath)) { //Definisikan Header header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.$filename); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($filepath)); ob_clean(); flush(); readfile($filepath); exit; } I think the root cause problem is need to input header('content-length') because the size of file become increase if without that. Thank you.
@ConsulthinkProgrammer3 жыл бұрын
Try this for additional reference WebApp - Login Form for Download Files kzfaq.info/get/bejne/qNGKnZCE0JO8qoU.html kzfaq.info/get/bejne/aNSpjNeS07-nZI0.html
@kevinchristiancastillo2017 Жыл бұрын
WOW..thank you sir, helps me alot...also Thanks to the uploader of this video @CodeFlix...Godbless
@heythere_6962 жыл бұрын
thank you sou much it work 👌👍
@CodeFlix122 жыл бұрын
♥️♥️♥️
@rohanmp-rt1si Жыл бұрын
Thank lot sir,,,
@getsetflycoding88653 жыл бұрын
hey bro , when i download image and open it . it would not open and give not supported msg;
@CodeFlix123 жыл бұрын
Just try for one of my videos and see Because I tried that If that doest work just check for the extension you are putting in code
@rhuzaifa4 жыл бұрын
This Is Not working in Opera Version:65.0.3467.78
@CodeFlix124 жыл бұрын
Is there any error coming or it is just not working
@huzaifarasheed23134 жыл бұрын
Hi from my other account. My answer. No it does not give any error... I explain the situation below I have 2 files namely index.php and downloadexcel.php. In index.php i have a button which sends the session information to downloadexcel.php. The downloadexcel.php file gets the data from sql table and inserts into the excel file.. The code runs perfectly fine in Chrome, Firefox and IE. But does not run in Opera. When i Launch Opera And Click On the download button it downloads the file but this works only one time in Opera. When i click on the download button again it does not download the excel file this time. When i restart opera it works again but for one time only. The headers i used in the downloadexcel.php file are as follows. header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') n header ('Content-Disposition: attachement;filename="name.xlsx"');
@huzaifarasheed23134 жыл бұрын
What am i missing? Is there any cache problem for opera?
@CodeFlix124 жыл бұрын
Yes you are not missing anything. This is a browser related issue. Browser does not support this type of caching
@huzaifarasheed23134 жыл бұрын
@@CodeFlix12 what would i need to do to run it on Opera. As this is my project for a collage course which requires the project code to be compatible with all the main stream browsers. Do i need to Change or Add A header?
@danielsedoyeka65014 жыл бұрын
Thanks for the lessons
@CodeFlix124 жыл бұрын
Always a pleasure sir!
@soumikbhattacharya89383 жыл бұрын
Hello, this code perfectly works on localhost but not working on live server, can you please help regarding that. Output shows binary file.
@CodeFlix123 жыл бұрын
The files are correctly uploaded on server?
@soumikbhattacharya89383 жыл бұрын
@@CodeFlix12 yes correctly uploaded, with proper permission. But the problem is when i click download button, instead of downloading this file it's open in binary format.
@CodeFlix123 жыл бұрын
Maybe try changing the extension of files
@abdullahbutt41664 жыл бұрын
Dear brother is the procedure same if the download file is pdf not image
@CodeFlix124 жыл бұрын
Yes the procedure is same
@MrDovanele4 жыл бұрын
What not do do 101. WARING!!! excellent to download any file, I mean any system file!!! never trust user input, and make sure you just don't allow url params to decide full path of the file...
@CodeFlix124 жыл бұрын
True, but somewhere we have to give user flexibility
@MrDovanele4 жыл бұрын
@@CodeFlix12 You just need to point those things out very clearly as most "new" people just copy code without realising it or just add comments inside code when showing example
@marcusaureliusregulus28333 жыл бұрын
Hey. I don't get explorer popup to choose download location
@divijatagautamrajan96544 жыл бұрын
after downloading, the image is not displayed. what should i do
@CodeFlix124 жыл бұрын
The path to the image might b wrong
@yudhawibowo7773 жыл бұрын
Hello , for solutions this problem you can see my comment at the top. Thank you
@meryamsoussi24544 жыл бұрын
thank you that was so helpful
@CodeFlix124 жыл бұрын
❤️❤️
@marcusaureliusregulus28333 жыл бұрын
Hey. I don't get explorer popup to choose download location
@CodeFlix123 жыл бұрын
Make input type to file to do that
@marcusaureliusregulus28333 жыл бұрын
@@CodeFlix12 Fixed👍
@CodeFlix123 жыл бұрын
♥️♥️
@debanjandey32673 жыл бұрын
in ur video u mentioned image1.jpg ........ but what if I used a form and I wrote my name and thats the name of the jpg which immediately created in the folder....I mean to say u dont know when u r writing the code that whats the name of the jpg will be....... in that case what should I write in the blank space??? click here
@CodeFlix123 жыл бұрын
Just autofill it with php then
@debanjandey32673 жыл бұрын
autofill???
@debanjandey32673 жыл бұрын
can u plzz elaborate???
@CodeFlix123 жыл бұрын
Bring the name from database and fill it It will be dynamic then
@debanjandey32673 жыл бұрын
@@CodeFlix12 can I contact u in person... email or whatsapp!?
@gopinath-jd1tl2 жыл бұрын
thank you sir
@CodeFlix122 жыл бұрын
❤️❤️
@mikailsumenoglu5482 жыл бұрын
readfile($filepath); over addding; ob_clean(); flush();
@user-oj2qy8iu6n2 жыл бұрын
Is it possible to do the downloading in the background?
@CodeFlix122 жыл бұрын
It happens in bg once you click download
@TSr_1194 жыл бұрын
And what have I to do when i have the image in a folder
@TSr_1194 жыл бұрын
Thx bro i found the solution
@CodeFlix124 жыл бұрын
Sure sir
@kriptoedits99783 жыл бұрын
Can we use this only for pics?
@CodeFlix123 жыл бұрын
For anything
@maicolpini81364 жыл бұрын
how i can do it for an apk? Because i don?t get any error but it doesn't download anything
@CodeFlix124 жыл бұрын
The file location of apk would be wrong sir!
@maicolpini81364 жыл бұрын
Sorry but it' s like in your video, it founds the file else i would have get an error. It doesn't start the download can you help me sir?
@CodeFlix124 жыл бұрын
Sir if the location of the file is wrong it won't give an error