File Upload Script Question

Xiphoid

Newcomer
Joined
Apr 21, 2003
Messages
1
Hi all, I'm new to this forum and was recommended here by a friend. I've heard great things about it. :)

I'm a webmaster of a rather large gaming site, PlanetAgeofMythology (www.planetaom.com) on the GameSpy Network, and I'm running into a problem with uploading. My problem is the following:

I have access to two servers, one set up for cgi, perl, and scripts and another server for heavy bandwidth stuff. With the cgi one, I host my forums and bandwidth is somewhat limited while I have the my regular site with downloads and such on the other server.

Due to popular demand, users want to be able to attach files to their topics when they post and I obtained a script to do this. The script works great; however, once we had about fifty people downloading and uploading the files all at once, the server crashed and my host became angered with me.

What I am looking for advice on is how I can have the upload script running on the cgi server and have the uploads going onto the main server with lots of bandwidth and space. I'm curious as to whether or not there's a script or certain code out there that will allow a direct path of access to another server so I can run the script on one and upload to another. If that's not feasible, is there an automated script that will transfer the files from one server to another?

I've asked dozens of people about this and posted on many forums but still to no avail. I've heard that it's both impossible and very possible, but hard.

Any help would greatly be appreciated. If anyone could figure this out, I'd be greatly in debt to them as it's pretty important in the expansion of my site.

Thanks :)
 
I have my AOM CD sitting on my bureau. I really wish I had time to play it like I did AoK:TC. Oh well... days gone by.

Regardless, there are ways of doing what you're asking. The simplest method is to upload the file to the secondary (high bandwidth) server from a form located in an auxiliary window. This form would only handle attachments, and would post to either a CGI, Perl, PHP, etc. script on the high bandwidth server. The file would then be associated with the post in a database field-- most likely the table that holds the posts. I've used this method before, and done correctly it can work seamlessly.

A secondary method requires a drive to be mapped to a network share. The upload would then be saved to that share (located on the high bandwidth server). This is a rather simple solution if the servers are in your control (colocated, dedicated, in-house). This would not reduce the upstream load on the server, however it would transfer the downstream load to the high bandwidth server.

A tertiary method requires a socket-based connection between the servers, and while this is now easy to do in languages such as ASP.NET, in Perl or PHP it probably isn't going to be as easy. Ultimately this has the same benefits and cons as the previous method, although there is a small reliability hit due to the socket-based transfer.

It all depends on what you have available in front of you though. Server security is usually the biggest road-block in implementing a system such as this, since network shares, socket access and script execution aren't always enabled.
 
Back
Top