![]() |
|
upload multiple files and keep previous files like github do PHP/MYSQL - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: upload multiple files and keep previous files like github do PHP/MYSQL (/showthread.php?tid=6199268) |
upload multiple files and keep previous files like github do PHP/MYSQL - blackcoder00 - Mar 29, 2022 Hi hackforums family , my problem is that i want to upload multiple files (php/html/css etc..) and keep my old version of files like github does, like to upload new files and when i want go back to my olds files i find it and i can download it i searched in the forums if there's someone that asked about this topic to help me and i didn't find anything the main idea is that i can upload files (html/css/sql etc..) and when i want to upload new files i can anytime go back and find the old version of files like github exactly PHP Code PHP Code RE: upload multiple files and keep previous files like github do PHP/MYSQL - Nachfolger - Mar 29, 2022 Are you trying to show a comparison view, or just have an index (log) of file revisions? Your code is not secure. Among the many issues, I'm scared by the fact that you're allowing users to choose where the file is stored on your server... Also, your error messages give way too much background detail; why should the end user know the exact database connection error message? Last, but far from least, why are you not using prepared statements? I know for a fact that I have told you a million times to switch. I wrote this post a long time ago, but you would benefit from actually listening to what it has to say. See below: (Sep 11, 2019 09:21 AM)Nachfolger Wrote: [...] RE: upload multiple files and keep previous files like github do PHP/MYSQL - SIM-2502833 - Mar 29, 2022 Could use something like gitlabs. RE: upload multiple files and keep previous files like github do PHP/MYSQL - blackcoder00 - Mar 30, 2022 (Mar 29, 2022 05:16 PM)Nachfolger Wrote: Are you trying to show a comparison view, or just have an index (log) of file revisions? i want to upload many files of a project and if im gonna upload new file and i could reach the old one anytime exemple if im gonna upload (index.html / search.php) if im gonna update the code of search.php and upload it again , i can anytime reach the old file like : upload : search.php (for the first time) next if i want to update the code of search.php and upload it again i can reach the old file anytime like the github does RE: upload multiple files and keep previous files like github do PHP/MYSQL - Nachfolger - Mar 31, 2022 (Mar 30, 2022 09:28 AM)blackcoder00 Wrote: i want to upload many files of a project and if im gonna upload new file and i could reach the old one anytime exemple It looks like this project is for deploying changes to your own website, is there a reason why you're not using a git service for this? RE: upload multiple files and keep previous files like github do PHP/MYSQL - blackcoder00 - Mar 31, 2022 (Mar 31, 2022 04:50 AM)Nachfolger Wrote: It looks like this project is for deploying changes to your own website, is there a reason why you're not using a git service for this? it's a university project that i need to clone the github website functionality ( i need to create the same ecosystem of github) that when i upload some file of a project (php/html etc...) and after that i update the code of some file of that project and upload it again i can reach the previous file ( old one ) anytime i want like github does i need to do it with php exemple : 1)upload (index.html) after that i want to modify some line in index.html 2)upload it again the new file it gonna replace the old one in the website and display and if i want to go back and dowlnload the old file that i modified i can do it (like github does) this is the first time that we talk about the ecosystem of github in the forums i hope that someone can help me to build it with php RE: upload multiple files and keep previous files like github do PHP/MYSQL - Disease - Apr 1, 2022 This isn't what Git does. I understand the confusion, but version control is a different concept entirely. If you want to have the benefit of Git, you could always set up a CI/CD pipeline. But I don't think that's what you're actually trying to accomplish here. Sounds more like you're attempting to retain all uploads. To do that you'll want to check if that file already exists when you are executing the upload. And if it does, either upload the new file with a new name, or rename the previous file(s). |