Re: Uploading a file to server behind a firewall
| From: | Andre Cerqueira | Date: | Fri, 27 Feb 2004 05:23:40 +0000 |
| Subject: | Re: Uploading a file to server behind a firewall | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178988@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
i dont know if that can be fixed using php, it looks like a firewall setup problem?
which port is apache running?
i got confused with your ponctuation and explanations, maybe some rephrasing and more details, like error message, could help
Rick Laird wrote:
I am trying to upload a file to a server behind a firewall. Notes It works fine from inside the firewall. I access the server and run the following- -- André Cerqueira -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAPtRhaxdA/5C8vH8RAiIjAJ9wtAfZ9UV0FcabcfXv7z6qZxQIiwCg1DGR H3D5zq0s/2XSFIJSDiBKLKA= =4OMG -----END PGP SIGNATURE-----<?php phpinfo(); ?>Bug when I run the following code. It works in from within the firewall. But not from outside. I have port forwarding turned on obviously. But is there anything else that I need to do. Any help would be much appreciated. Thanks Rick Laird <?php if ($HTTP_POST_VARS['action']) { ?> <!-- Code to process Uploaded File and Display --> <!-- The HTML to display the results --> ?> <BR><A HREF="<?php echo $PHP_SELF ?>">Back</A> </FONT></P> </BODY> </HTML> <?php } else { ?> <HTML> <HEAD> <TITLE>File Upload</TITLE> </HEAD> <BODY BGCOLOR="WHITE" TEXT="BLACK"> <P><FONT FACE="Arial, Helvetica, sans-serif"><FONT SIZE="+1">FileUpload</FONT><BR><BR><FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="<?php echo $PHP_SELF;?>"> <INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="800000"> <INPUT TYPE="HIDDEN" NAME="action" VALUE="1"> File 1: <INPUT TYPE="FILE" NAME="file1" SIZE="30"><BR><BR> <INPUT TYPE="SUBMIT" VALUE="Upload"> </FORM> </FONT></P> </BODY> </HTML> <?php } ?> <?php if ($HTTP_POST_VARS['action']) { ?> <HTML> <HEAD> <TITLE>File Upload Results</TITLE> </HEAD> <BODY BGCOLOR="WHITE" TEXT="BLACK"> <P><FONT FACE="Arial, Helvetica, sans-serif"><FONT SIZE="+1">File Upload Results</FONT><BR><BR> <?php $uploadpath = '/files/'; $source = $HTTP_POST_FILES['file1']['tmp_name']; $dest = $uploadpath.$HTTP_POST_FILES['file1']['name']; if ( move_uploaded_file( $source, $dest ) ) {echo 'File successfully stored.<BR>';} else {echo 'File could not be stored.<BR>';} ?> <BR><A HREF="<?php echo $PHP_SELF ?>">Back</A> </FONT></P> </BODY> </HTML> <?php } else { ?> <!-- File Upload Form HTML Code Here --> <?php } ?>