Unfortunately, it doesnt seem to be that simple. I use a java application called Jumploader to upload the files.
Here is my index page (which gives parameters for the java applet):
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Christian County Video</title>
<meta name="generator" content="tsWebEditor (tswebeditor.net.tc - www.tswebeditor.tk)" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor=#CCCCCC background="../img/welcome.jpg">
<center>
<applet name="jumpLoaderApplet"
code="jmaster.jumploader.app.JumpLoaderApplet.class"
archive="jumploader_z.jar"
width="750"
height="350"
mayscript>
<param name="gc_loggingLevel" value="DEBUG"/>
<param name="uc_uploadUrl" value="/Jumploader/uploadHandler.php"/>
<param name="uc_uploadThreadCount" value="1"/>
<param name="uc_maxFiles" value="-1"/>
<param name="uc_maxFileLength" value="-1"/>
<param name="uc_maxLength" value="-1"/>
<param name="uc_fileNamePattern" value=""/>
<param name="uc_directoriesEnabled" value="true"/>
<param name="uc_duplicateFileEnabled" value="false"/>
<param name="uc_fileParameterName" value="file"/>
<param name="uc_fileNamePolicy" value="name"/>
<param name="uc_logServerResponse" value="true"/>
<param name="uc_partitionLength" value="-1"/>
<param name="vc_lookAndFeel" value="system"/>
<param name="vc_localFilesViewEnabled" value="true"/>
<param name="vc_addFilesActionEnabled" value="true"/>
<param name="vc_logoEnabled" value="true"/>
<param name="vc_logoUrl" value="http://youserver/yourfile.png"/>
<param name="vc_fileTreeShowFileLength" value="true"/>
<param name="vc_fileTreeUploadSplitLocationPercent" value="40"/>
<param name="ac_fireUploaderFileAdded" value="false"/>
<param name="ac_fireUploaderFileRemoved" value="false"/>
<param name="ac_fireUploaderFileStatusChanged" value="false"/>
<param name="ac_fireUploaderFilesReset" value="false"/>
<param name="ac_fireUploaderStatusChanged" value="false"/>
</applet>
<?php
?>
</body>
</html>
And here is my upload handler.php file:
Code:
<?php
//----------------------------------------------
// upload file handler script
//----------------------------------------------
//
// specify file parameter name
$file_param_name = 'file';
//
// retrieve uploaded file name
$file_name = $_FILES[ $file_param_name ][ 'name' ];
//
// retrieve uploaded file path (temporary stored by php engine)
$source_file_path = $_FILES[ $file_param_name ][ 'tmp_name' ];
//
// construct target file path (desired location of uploaded file) -
// here we put to the web server document root (i.e. '/home/wwwroot')
// using user supplied file name
$target_file_path = "c:\upload\ " . $file_name;
//
// move uploaded file
echo "Moving file " . $source_file_path . " > " . $target_file_path . ": ";
if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
echo "success";
} else{
echo "failure";
}
//
// below is trace of variables
?>
<html>
<body>
<h1>GET content</h1>
<pre><?print_r( $_GET );?></pre>
<h1>POST content</h1>
<pre><?print_r( $_POST );?></pre>
<h1>FILES content</h1>
<pre><?print_r( $_FILES );?></pre>
</body>
I've researched some to find a potential formula through sessions. I can upload files to a user directory (I think) by changing the upoad path in the uploadhandler to :
Code:
$target_file_path = "c:\upload\ " . $_SESSION['usuario'] . "/" . $file_name ;
And then putting the following in the login.php page:
Code:
session_start();
$_SESSION['usuario'] = $loginUsername;
But hen how do I post a blank username in the login.php?