Forum Moderators: coopster

Message Too Old, No Replies

Setup for Upload-file server at home and actual web-server on Web

         

siebe

1:10 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



Hi All,
This is the situation:
On my website I have limited Ram and Hard Disk Space.
The site is offering uploading photos. Because of above limitations I am thinking of setting up an extra php-file-server at home.

The challenge:
An upload-form that:
1. Uploads the photo directly to the home-server, processing the photo (resizing and sharpening using php) and
2. Also maintains session to web-server dealing with Mysql and also php. The web server should wait until finishing on processing home-server.

Home-server environment: Windows Xp, Mysql and php in latest versions
Web server environment: Linux, Mysql and php

[edited by: siebe at 2:20 pm (utc) on Feb. 22, 2004]

ikbenhet1

1:46 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



Hi siebe, please read the TOS, as urls are not allowed.

As for the question, the only way i know how to do this is use curl.

first you upload the image to the server with little ram, then include a php file in the upload php file after the image is oploaded in that includes a execute from your home server shell_exec("curl -o [savetofilename] [example.com...] throug php
which will transfer the file and then use shell_exec("rm [example.com...] from the slow server to remove the image.

make sense? try a search for "php resize image" that should give you examples of resizing images in php as i have no examples of this.

siebe

2:27 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



Hi ikbenhet1

Sorry, I have corrected that.
I will check curl.
Resizing is not the problem.
Thanks in advance

Siebe

jatar_k

5:47 pm on Feb 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld siebe,

I assume the upload form is located on your webserver. Why not make a file on your local machine the action of the upload form?

curl from the form to your home machine might work as well.

How big are the images you are going to upload? Can't you just upload, process and then delete the orig?

siebe

6:18 pm on Feb 22, 2004 (gmt 0)

10+ Year Member



Hi Jatar,

Yes I thought about that possibility as well.
But how to preserve the session with the web-server, not knowing when and which file has been uploaded.
On the web-server the mysql database needs some insert as well.
Do you have any ideas?

Siebe

jatar_k

7:45 pm on Feb 22, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe even the form should be located on your machine.

I don't really know, my best advice would be to get more webspace and do it all on the web server. I think you are only in for a ton of headaches otherwise.