Hi. I tried everything that the video said, and i also copied the sample codes, but i was only able to select the file. The upload option did not work. Can some one please help me figure out what is wrong? Thanks in advance.
For ordering, you can save the filename as timestamp and display in descending order. Display image and video is simple, for pdf you have to use header content-type: application/pdf
Hello ! could it be changed to make each file have a checkbox and after selecting it could be deleted? also when uploading add the function that when the file has the same name and size it would display "the file already exists" ?
Hi Adnan I tried the way you showed in the video & its working fine but I'm not able to download txt and image files........can you suggest a code that I can add to make it work for image & txt files as well?
1) Can other computers access it just writing the local host path as long as your xamp server is on on your computer? 2)Do you know how to restrict access around a wifi, meaning people can access that page if they are connected to that specific wifi
nice one bro but how can i integrate it to the social site so if a user send message , friend request, group request and others the other will receive the sound notifications on his or her end? pls bro
For notification sound, you can follow this: ruclips.net/video/7mKXEiJu_Kg/видео.html It is HTML & Javascript, social network project is created in HTML & JS too, so you can integrate that with little work.
What amazing is this, you're the best,wawo special thanks i have been looking for this upload and download in php for a week and you have helped me.Once again thank you,very brief and specific.Please i would love to see when you also include error and extensions and file sizes for memory or space purposes.be blessed!!!!!!
@Jake Propst No problem. Everyone was once a newbie. You can check your browser console. There must be an error in your Javascript. Right click in your browser empty space, go to "Inspect Element" then in "Console" tab.
Funciona correctamente, necesito almacenar la ruta en una base de datos (MySQL)subiendo archivos .doc, .pdf con opciones para ver y descargar(Bueno eso la tiene en este ejemplo)...Alguna sugerencia !!
I didn't understand that. But I can tell that you are having problem in your MySQL database and may be unable to download or upload .pdf or .doc file ?
I created the files just like you said and when i open it google chrome just shows me the code i typed and nothing else. I am new to coding and i am doing this in order to set-up a file share website on our IIS server for lab use. Your application is exactly what i am looking for.
@@AdnanAfzal565 Many thanks for the reply. I was using IIS and reached to a point where it would load the index.php page. When i upload file, i get error "This page isn’t working; 10.0.0.99 is currently unable to handle this request. ; HTTP ERROR 500" I will do some research about XAMPP and update the thread.
im new to php...and im have written the code as in the video..but even though im getting an error like Object not found after clicking upload..pls help...!!!!!!
ive checked....everything is correct .im getting error in "upload.php " and also can u please explain "move_uploaded_file($file["tmp_name"], "upload/".$file["name"]);" im confusedwith that...
please i need your favor to this issue.. i download a excel file from local server, then i edit the file, then i upload it, i need to know is my file updated or not so i download the file again.. the system should've overwrite it but it's not.. but in the server PC it's updated.. tell me how to update the download link
When you are uploading the file, append the timestamp in it. Like this: move_uploaded_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"] . "-" . time());
In your move_uploaded_file function, set second parameter to the file name of your choice. For example, move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/My-file.png");
FOR MAC USERS make sure the uploads folder is read & writable. it is read only by default because many xampp folders are defaulted that way. Right click folder, click get info, unlock, change to read and write, now it should work. Thats why windows users are saying success while mac users are pulling their hair out.
There is no general method that will display any kind of file in the browser. You have to put conditions on each type of file and call functions separately. For example, to display the PDF file, you can follow: adnan-tech.com/pdf-view-in-browser-and-export-as-file-php/ To display Excel file, you can follow: adnan-tech.com/create-and-read-excel-sheets-with-styles-and-dynamic-data-php-mysql/
I used the upload.php in the end of the file, the last 2 lines, the code cannot download any file. Note: I used it to my website not for local host. upload file
outp put is : New Text Document (9).txt Array ( [0] => . [1] => .. [2] => New Text Document (9).txt so, when I click on the > its output is: Failed - No File
You need to enable following 4 properties in your "php.ini" file located in "xampp/php/php.ini": upload_max_filesize - The maximum allowed upload file size. post_max_size - The maximum allowed POST data size. max_input_time - Maximum allowed input time. max_execution_time - The maximum allowed time the scripts are allowed to run.
Thanks This is a very usefull tutorial but i have a question how can i run it on a server becouse i want to upload a file on my pc and download it on a nother pc. it would be very nice if somone can help me. (sorry for my bad english :) )
You need to develop a new app for this, sketchwsre is quite different. You can follow this: adnan-tech.com/profile-update-with-picture-android-java-php-and-mysql/
I got it from here: www.fiverr.com/rizwanafzal1988/do-intro-video-for-youtube-of-caveman-breaking-stone?ref_ctx_id=11e71513-b629-48f5-a269-fc667f45e7dd
I've been looking for this for almost two weeks now :)
i have been looking for this since so long didn't find a perfect video except this!!!😭❤️
Glad to hear that. Thanks.
love your outro
Thanks.
Thank you!
What if i need to put it the links at table,
(# , title, download link) ?
Plz need script or video like this
Hi. I tried everything that the video said, and i also copied the sample codes, but i was only able to select the file. The upload option did not work. Can some one please help me figure out what is wrong? Thanks in advance.
What error are you seeing ?
This was very important for me. I had searched how to do this fr a long time. Thank you
You’re welcome.
if i could now know how i can make the displayed documents in order from the most recent to the least, it will be so good.
and also if i want to have another option of viewing the document instead of downloading it
For ordering, you can save the filename as timestamp and display in descending order.
Display image and video is simple, for pdf you have to use header content-type: application/pdf
Hello !
could it be changed to make each file have a checkbox and after selecting it could be deleted?
also when uploading add the function that when the file has the same name and size it would display "the file already exists" ?
Yes, for deleting you can use "unlink()" function and for checking duplicate file name, you can use "file_exists()" function.
is there anyway to create a new page to download and not just the same one with the download button ?
Do you have any design so I can get the idea ?
Just what I needed for my testing site thank you so much
Glad I helped.
I hope there are more You tubers like u
Thanks. Great to hear.
Keep sharing to help me reach more people.
tp gimana cara kita linkkan agar file dapat di upload/download oleh setiap user tanpa di tampilkan ke user lain. sekali lagi terima kasih..!
Jika Anda memiliki sistem login maka Anda dapat menetapkan suatu kondisi berdasarkan ID pengguna.
Good tutorial. Right to the point!. Thanks a lot.
Hi Adnan
I tried the way you showed in the video & its working fine but I'm not able to download txt and image files........can you suggest a code that I can add to make it work for image & txt files as well?
The code should be same for all files. Make sure the path and file name is correct.
Sir whenever i click upload it doesmt do anything. the file is not there
Never mind hahaha i fixed it
Great :)
1) Can other computers access it just writing the local host path as long as your xamp server is on on your computer?
2)Do you know how to restrict access around a wifi, meaning people can access that page if they are connected to that specific wifi
No. They can only access if they know your ipv4 address which can be get only from ipconfig /all command.
It's the precise and clean!!! Thanks Adnan!
You're welcome (Y)
Thank you, but I had trouble downloading a file or an image that doesn't do what I do.
Which type of file you are trying to download ?
when I click on the file ... it downloads the file with error: failed ... no file.
It is because you have selected the wrong file path, please double check your spellings.
i have the same error, help please
You need to double check your spellings. It says that the file is not found on server.
why the index $a starts at 2? ($a=2 in for loop)
because the first 2 indices are for "." current directory and ".." previous directory
Thumbs up dude u made it so simple
You're welcome. Make sure you subscribe for more helpful videos.
That's what I call a man Job! Right to the point...Good job buddy!
Thanks.
nice one bro but how can i integrate it to the social site so if a user send message , friend request, group request and others the other will receive the sound notifications on his or her end?
pls bro
For notification sound, you can follow this: ruclips.net/video/7mKXEiJu_Kg/видео.html
It is HTML & Javascript, social network project is created in HTML & JS too, so you can integrate that with little work.
i did everything like in the vid,but when i click on the upload button, nothing happens. Can you help?
Can you send your code here ?
INDEX.php :
Your tag is not properly closed. Use this:
Thank you,but it still dont work. It does not even show the uploaded files,and i cant find them in the uploads folder neither. :/
Check your directory permissions, it should be 777.
What amazing is this, you're the best,wawo special thanks i have been looking for this upload and download in php for a week and you have helped me.Once again thank you,very brief and specific.Please i would love to see when you also include error and extensions and file sizes for memory or space purposes.be blessed!!!!!!
Sure. Will do that too. Thanks.
@Jake Propst Can you explain what error you are facing ?
@Jake Propst No problem. Everyone was once a newbie.
You can check your browser console. There must be an error in your Javascript.
Right click in your browser empty space, go to "Inspect Element" then in "Console" tab.
works like magic. two thumbs up*
hi sir..im using datatables..i want to the download the specific file in my upload folder how can i do that..please help me..thank you
If you follow this tutorial completely, you will be able to download files.
thats what i was looking for...Thank you
You're welcome
Very Good & simple video
Funciona correctamente, necesito almacenar la ruta en una base de datos (MySQL)subiendo archivos .doc, .pdf con opciones para ver y descargar(Bueno eso la tiene en este ejemplo)...Alguna sugerencia !!
I didn't understand that. But I can tell that you are having problem in your MySQL database and may be unable to download or upload .pdf or .doc file ?
I created the files just like you said and when i open it google chrome just shows me the code i typed and nothing else. I am new to coding and i am doing this in order to set-up a file share website on our IIS server for lab use.
Your application is exactly what i am looking for.
You need to work in XAMPP htdocs
@@AdnanAfzal565 Many thanks for the reply. I was using IIS and reached to a point where it would load the index.php page. When i upload file, i get error "This page isn’t working; 10.0.0.99 is currently unable to handle this request.
;
HTTP ERROR 500"
I will do some research about XAMPP and update the thread.
@@AdnanAfzal565 I installed XAMPP on the server and it works beautifully. Thanks for the help.
Just what we needed here.
@@ss11235 Yes, search for php.ini file in XAMPP/php folder. And search for max_upload_filesize
@@AdnanAfzal565 Great info Can we add a delete file option next to the download links? Can you help with the code please.
im new to php...and im have written the code as in the video..but even though im getting an error like Object not found after clicking upload..pls help...!!!!!!
It is because you have an error in file name spellings. Double check if your file name is same as in your code.
ive checked....everything is correct .im getting error in "upload.php " and also can u please explain "move_uploaded_file($file["tmp_name"], "upload/".$file["name"]);" im confusedwith that...
@@gnaneshgn8341 It will save the file in server directory. Make sure you have a folder named "upload"
but i think it doesnt upload files more than 2mb
You can always change the maximum upload file size from file "php.ini". You will see 2 directives in that file:
upload_max_filesize
and
post_max_size
@@AdnanAfzal565 how sir?
@@AdnanAfzal565 got it already.. thanks :)
@@janmichaelbesinga3867 Great, let me know if you have any question.
please i need your favor to this issue.. i download a excel file from local server, then i edit the file, then i upload it, i need to know is my file updated or not so i download the file again.. the system should've overwrite it but it's not.. but in the server PC it's updated.. tell me how to update the download link
When you are uploading the file, append the timestamp in it. Like this:
move_uploaded_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"] . "-" . time());
@@AdnanAfzal565 then it will add a new file instead overwrite it.. I need to update that download link.. thank you for your kindly reply
@@novelchandra8329 if the file name is same, then it will be updated.
@@AdnanAfzal565 but in the code you've given to me it would be filename-time right??cmiiw
Yes.
How to save the uploaded file in the uploads folder with a specific name?
In your move_uploaded_file function, set second parameter to the file name of your choice. For example,
move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/My-file.png");
@@AdnanAfzal565 thank you so much :)
thanks for this but my issue is i have a registration form but i want it to upload multiple files. any help
Yes, you can upload multiple files by following this:
ruclips.net/video/eHEDJBk3ie0/видео.html
Thank You For sharing your source code it done its work
You are welcome.
Thank you very much for this coding tutorial :D
FOR MAC USERS
make sure the uploads folder is read & writable. it is read only by default because many xampp folders are defaulted that way. Right click folder, click get info, unlock, change to read and write, now it should work. Thats why windows users are saying success while mac users are pulling their hair out.
Thanks for sharing.
Very clear, thanks a lot man you made my day
Glad to hear that!
Thanks this is what i looking for
You are welcome.
Thanks! This is very useful and simple
Please can you put the download file i need it
Sure. I will soon upload it on some git repository and will share link with you.
If I create a system like this in pc ,can I download the file with phone ?
Yes.
where does the file upload to?
and can i download even if its not on my computer?
Yes.
Thank you this helps a lot
You are welcome.
@@AdnanAfzal565 bro its saying php warning: File upload error - unable to create a temporary file in uknown on line 0
@@macahilosclarkq.1672 Check if you have any error in files object, like following:
print_r($_FILES["video"]["error"]);
It's very simple ... thanks a lot
You’re welcome.
Hey do you know how to put images and description for the uploaded files?
Yes, just create another column in database with description of images.
Also thanks for this video it helped me
You are welcome.
Can you please help with the code for a banner on top of index.php page
Yes.
register is not done verifying my gmail
3 mb up file size. cannot be uploaded.. but why??
upload_max_filesize = 2M
post_max_size = 2M
Search these values in php.ini and update them to 10M or higher.
Thank you so much, its really helpful.
Glad it was helpful!
I don't know how to get the localhost thingy
You can simply download XAMPP, WAMP or MAMP for localhost.
Can someone tell me if i can make it online with free web hosting sites??
The link automatically downloads the file rather than opening it...help
Yes, this tutorial is about downloading the file. What type of file you want to view in the browser (pdf, excel etc.) ?
Adnan Afzal i want every file type to get opened...i tried this pdf is directly downloading..docx and jpeg are opeing
There is no general method that will display any kind of file in the browser. You have to put conditions on each type of file and call functions separately.
For example, to display the PDF file, you can follow:
adnan-tech.com/pdf-view-in-browser-and-export-as-file-php/
To display Excel file, you can follow:
adnan-tech.com/create-and-read-excel-sheets-with-styles-and-dynamic-data-php-mysql/
Adnan Afzal Okay thanks for the help
How do I add a delete button that deletes the file I want to rid of?
You can call built-in PHP function:
unlink("path_of_file");
to delete the file.
@@AdnanAfzal565 Ok, but how do I "grab" the full name from the script and get it into the unlink("full_name.here")?
Can I also use a button instead of the
Yes, to download files you can use an anchor tag.
pls code
Here it is:
adnan-tech.com/tutorial/upload-download-and-delete-files-php
so how i can uploaded into mysql database?
You can save the path using following mysql query:
INSERT INTO uploads(path) VALUES ($path)
@@AdnanAfzal565 i already do this but its not working when i submit it will not go into the database
Make sure you have correct database, table and column names.
I used the upload.php in the end of the file, the last 2 lines, the code cannot download any file. Note: I used it to my website not for local host.
upload file
Just print_r($files) and see the files returned.
Failed- No file
Failed - No File
outp put is :
New Text Document (9).txt
Array ( [0] => . [1] => .. [2] => New Text Document (9).txt
so, when I click on the > its output is:
Failed - No File
did this file goes into the database?
No. It will only be saved physically in uploads folder.
terima kasih, sangat berguna. tapi untuk menghapus masih tidak berfungsi.
kesalahan apa yang Anda lihat?
@@AdnanAfzal565 tidak muncul pesan kesalahan. tolong berikan tutorial penggunaan unlink untuk penghapusan file. terima kasih
@@muhammadiqbalkaplale8220 tutorial ini memiliki fungsi unlink. periksa apakah Anda memiliki izin menulis.
can you please send the source code
How we can download files from file zila to local server ?
You can right click on file you want to download and click "export to local"
Adnan Afzal I want to download complete folder from file zila (sftp protocol) to local server using php
Okay. I will shortly provide you tutorial for that too.
Adnan Afzal thank u ...
here is your requested tutorial: ruclips.net/video/91glKPKpogE/видео.html
please let me know if you have any issues
whenever i am downloading its say failed no file
Make sure the path of file in server is correct. You need to give full file name including the extension.
How to upload a large file
You need to enable following 4 properties in your "php.ini" file located in "xampp/php/php.ini":
upload_max_filesize - The maximum allowed upload file size.
post_max_size - The maximum allowed POST data size.
max_input_time - Maximum allowed input time.
max_execution_time - The maximum allowed time the scripts are allowed to run.
@@AdnanAfzal565 thanks
@@takzobye Welcome. Keep sharing.
@@AdnanAfzal565 I dont have
post_max_size
max_execution_time
max_input_time
I only have upload_max_filesize
@@takzobye That's okay, it depends on server and PHP version. Try restarting XAMPP and it will work.
Is there a way to chech file size and than hande the info?
Yes. You can use $_FILES["file"]["size"]. It will return the file size in bytes.
@@AdnanAfzal565 thx
You are welcome.
thanks you really helped me..
Yeah...sure...
Thanks This is a very usefull tutorial but i have a question how can i run it on a server becouse i want to upload a file on my pc and download it on a nother pc. it would be very nice if somone can help me. (sorry for my bad english :) )
You can simply upload this code to a hosting server. Upload the file from 1 PC. Access the web page from 2nd PC and download the file.
kalo untuk menghapus file bagaimana ?
gunakan fungsi unlink (file_name)
Thank you for this tutorial :)
You're welcome.
thank you sir ! you very helping me !
You are welcome. Glad to hear that.
Very useful thank u♥
You are welcome.
On point 🙌🙌🙏
Thanks.
Awesome . Thank you
Hello, how can i upload in sketchware
You need to develop a new app for this, sketchwsre is quite different. You can follow this:
adnan-tech.com/profile-update-with-picture-android-java-php-and-mysql/
great work bhai
thanks
Great video
Thanks. Keep sharing please.
you r amazing. thank you
You are welcome.
good , very helpfull
Thanks.
helpful tutorial
Thanks.
Super nice
Thanks.
helpfull.thanks
You're welcome.
Legit life saver!!!
amazing
Can I do that with just html?
You can do the download with HTML. But upload cannot be done with only HTML.
it working in html file?
No, you have to use php file.
Thankyou so much
You are welcome.
How to download your code
Link is in the description. You need to register an account to download.
THANK YOU :)
Thanks bro,
Helpfull (Y)
thank you so much
You're welcome.
good tutorial
Thanks.
Not use Database ??
You mean you want to download the file saved in the database? And save the uploaded file path in the database?
@@AdnanAfzal565 yes I want to download and upload the save file in the mysql database, can you know your script can be used in the database ??
You can follow below tutorial to fetch and save data in database:
ruclips.net/video/oie6T8IVeMA/видео.html
@@AdnanAfzal565 oke tanks for to be information
Does this work on mobike
Yes.
not working ..
What error are you seeing ?
Thank You
You're welcome
Ty :)
You are welcome.
Internal server error
Error in your PHP file.
wow that into = like
I got it from here:
www.fiverr.com/rizwanafzal1988/do-intro-video-for-youtube-of-caveman-breaking-stone?ref_ctx_id=11e71513-b629-48f5-a269-fc667f45e7dd