What's new

Uploading/Removing Files From Site

X

XexChaos

Enthusiast
Messages
167
Reaction score
25
Points
80
Sin$
0
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!
 
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
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!
If I'm reading this correctly, right now you're uploading the files and then having to create an individual page/link for them manually?
 
X

XexChaos

Enthusiast
Messages
167
Reaction score
25
Points
80
Sin$
0
You can remove files based on a pattern http://superuser.com/a/392878

If I'm reading this correctly, right now you're uploading the files and then having to create an individual page/link for them manually?
Sorry I should have explained this better.

Basically my site is going to be like a library for downloads, for each file I'm currently having to download it, put it onto the correct directory, create a new PHP Function for it to download the file and then add the Link to the file in a HTML document.

This is very time consuming and considering I will soon be expanding to have 1000's of downloads I don't think I can continue to do this. What I'm looking for now is a system to which I can just upload the files into some kind of database and have them easily downloaded and accessed by users on my site.

Sorry if it sounds confusing but I have never messed with PHP Databases etc!
 
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
Sorry I should have explained this better.

Basically my site is going to be like a library for downloads, for each file I'm currently having to download it, put it onto the correct directory, create a new PHP Function for it to download the file and then add the Link to the file in a HTML document.

This is very time consuming and considering I will soon be expanding to have 1000's of downloads I don't think I can continue to do this. What I'm looking for now is a system to which I can just upload the files into some kind of database and have them easily downloaded and accessed by users on my site.

Sorry if it sounds confusing but I have never messed with PHP Databases etc!
As a concept, you could have a PHP file that reads a MySQL table that has information regarding your files (name, size, link, etc), and then lists all of them on to your site, obviously placing the 'href' values of the generated text as the link from the table. As for uploading, you can make a C# program that uploads the file and then another PHP file that uploads it's information to the database. You can utilize the C# program to send GET parameters to the PHP file automatically.
 
X

XexChaos

Enthusiast
Messages
167
Reaction score
25
Points
80
Sin$
0
As a concept, you could have a PHP file that reads a MySQL table that has information regarding your files (name, size, link, etc), and then lists all of them on to your site, obviously placing the 'href' values of the generated text as the link from the table. As for uploading, you can make a C# program that uploads the file and then another PHP file that uploads it's information to the database. You can utilize the C# program to send GET parameters to the PHP file automatically.
Thanks for the idea, how I'm going to put this into action I have no idea. Do you know of anywhere that I could see some open source examples of this to try and get a better understanding? I know what you mean but am lost in what to do.
 
Cakes

Cakes

お前はもう死んでいる
VIP
Retired
Mythical Veteran Platinum Record End of the Year 2017
Messages
20,705
Reaction score
20,272
Points
3,870
Sin$
-7
Thanks for the idea, how I'm going to put this into action I have no idea. Do you know of anywhere that I could see some open source examples of this to try and get a better understanding? I know what you mean but am lost in what to do.
You could do this extremely easy with Lumen.
 
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
Thanks for the idea, how I'm going to put this into action I have no idea. Do you know of anywhere that I could see some open source examples of this to try and get a better understanding? I know what you mean but am lost in what to do.
No idea about online examples, but I made the script you'd use for uploading file information. It assumes that your table name is "files", but you can change that. If you get this working, then I can continue to provide the other code.

 
X

XexChaos

Enthusiast
Messages
167
Reaction score
25
Points
80
Sin$
0
You can remove files based on a pattern http://superuser.com/a/392878

You could do this extremely easy with Lumen.

No idea about online examples, but I made the script you'd use for uploading file information. It assumes that your table name is "files", but you can change that. If you get this working, then I can continue to provide the other code.


Thanks for all the help guys. Will report back on how it goes.
 
P

pwfdc

Member
Bright Idea Programmer Experienced Veteran
Messages
1,540
Reaction score
677
Points
465
Sin$
0
DO NOT PUT YOUR DATABASE INFO IN ANY SORT OF CLIENT APPLICATION
Do you know how easy it can be stolen, and with that. I could drop all your tables.
And not only that, but a lot of servers by default restrict all MySQL access to local and will not allow external usage. Which means connecting to it would be impossible for your program.

This is something that can be done with Laravel so easy. A team member and I have built a file host in Laravel. You just have to get the location of the file on the server. That's it.
 
Last edited:
Xeren

Xeren

♦♦♦ God Complex ♦♦♦
Legendary Veteran Programmer Modder
Messages
5,668
Reaction score
2,107
Points
795
Sin$
0
DO NOT DO THIS
Never, I repeat never, store any of your database info like this. Do you know how easy it can be stolen, and with that. I could drop all your tables.
And not only that, but a lot of servers by default restrict all MySQL access to local and will not allow external usage. Which means connecting to it would be impossible for your program.

This is something that can be done with Laravel so easy. A team member and I have built a file host in Laravel. You just have to get the location of the file on the server. That's it.
I'm not the best with PHP, but how do you expect to do anything with the database if you didn't know it's name? Then there's also the fact you wouldn't even have the username and password. As for the second part:
You can utilize the C# program to send GET parameters to the PHP file automatically.
This method should work perfectly unless your PHP file didn't.
 
X

XexChaos

Enthusiast
Messages
167
Reaction score
25
Points
80
Sin$
0
Guys I need a noob friendly way of doing this, I'm still confused on this subject!
 
Top Bottom
Login
Register