You are viewing our Forum Archives. To view or take place in current topics click here.
Faster Way Of Uploading/Removing Downloads
Posted:

Faster Way Of Uploading/Removing DownloadsPosted:

MX
  • 2 Million
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 1,896
Reputation Power: 233
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 1,896
Reputation Power: 233
Alright so to get straight to the point, my new website is basically a hub for 100's of downloads.

Adding and removing each file manually takes up a lot of time and I was wondering if there is any kind of automated systems? Something where I would upload the files and then it would add it to my website automatically.

I have a small amount of C# Experience so I can do most of the Control Panel stuff if needed but when it comes to databases and PHP I'm completely lost.

A knowledgeable insight from someone would be highly appreciated!
#2. Posted:
Gr0wn
  • Wise One
Status: Offline
Joined: Nov 23, 201014Year Member
Posts: 518
Reputation Power: 22
Status: Offline
Joined: Nov 23, 201014Year Member
Posts: 518
Reputation Power: 22
I would personally use python for the task.

Python has a nice Ftplib library that would allow you to say login to the ftp and delete a file by ID or some key setup you have in place for the files. Meaning your script would just ask you for a key and would delete it instantly.

When you say delete the files automatically how would the automated system decide which get deleted? Is it based on time or your personal opinion?
#3. Posted:
MX
  • Winter 2016
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 1,896
Reputation Power: 233
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 1,896
Reputation Power: 233
Gr0wn wrote I would personally use python for the task.

Python has a nice Ftplib library that would allow you to say login to the ftp and delete a file by ID or some key setup you have in place for the files. Meaning your script would just ask you for a key and would delete it instantly.

When you say delete the files automatically how would the automated system decide which get deleted? Is it based on time or your personal opinion?

Thanks for the reply. For the deleting I Can deal with that doing it manually but the uploading takes a lot of time. Hopefully soon I will be expanding to having 1000's of files hosted on my site but uploading each file would take a while.

Do you think Python would be the best solution for this? Thanks man!
#4. Posted:
Gr0wn
  • Wise One
Status: Offline
Joined: Nov 23, 201014Year Member
Posts: 518
Reputation Power: 22
Status: Offline
Joined: Nov 23, 201014Year Member
Posts: 518
Reputation Power: 22
Once again I would like to say yes as python is very friendly when it comes to large data automation, you could set up some form of queue that consistently adds stuff to download after verifying the already queued files were successfully downloaded. If you need help with the actual code for this feel free to post some code here and I shall help or feel free to PM me about it!

Edit:

Speaking specifically you would probably want to either have a script client-side on your PC that connects to the server via ftp and uploads the files from your computer or you could use the socket library and connect to your server from a third party server and upload files from there using ftplib.
#5. Posted:
MX
  • Download King
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 1,896
Reputation Power: 233
Status: Offline
Joined: Jan 10, 201410Year Member
Posts: 1,896
Reputation Power: 233
Gr0wn wrote Once again I would like to say yes as python is very friendly when it comes to large data automation, you could set up some form of queue that consistently adds stuff to download after verifying the already queued files were successfully downloaded. If you need help with the actual code for this feel free to post some code here and I shall help or feel free to PM me about it!

Edit:

Speaking specifically you would probably want to either have a script client-side on your PC that connects to the server via ftp and uploads the files from your computer or you could use the socket library and connect to your server from a third party server and upload files from there using ftplib.

I have never really looked at Python nor have I looked at the server side of things.

The current way Im going around this is by having two files, the file I want to be downloaded from the site and a PHP file which contains the code to download the file.

I then have a HTML page where I created links which then use the PHP File to download the File.

I know it's cinfuwing and also very time consuming, so my best bet would be to look into Python and try and setup something like you stated earlier?
#6. Posted:
Gr0wn
  • Wise One
Status: Offline
Joined: Nov 23, 201014Year Member
Posts: 518
Reputation Power: 22
Status: Offline
Joined: Nov 23, 201014Year Member
Posts: 518
Reputation Power: 22
That sounds like a pretty confusing system, and yeah if you want help learning it or any help with code just PM or post on here.
#7. Posted:
ObscureCoder
  • Resident Elite
Status: Offline
Joined: Jun 29, 201311Year Member
Posts: 211
Reputation Power: 13
Status: Offline
Joined: Jun 29, 201311Year Member
Posts: 211
Reputation Power: 13
Basic PHP w/ a MySQL database.

At the least, store like: id (AI), name (varchar(255)), path (varchar) and date uploaded.
You could also add a description column and display that. Or even a download counter too.

Then simply add a row with the relevant data at the end of the upload script using PDO.

Then, on the downloads page, list all of the downloads by SELECT * FROM `downloads` and then loop through the response. You may wanna add a limit and consider doing pagination so you're not fetching every single row each time.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.