mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
initial import
This commit is contained in:
166
www/api/test.php
Normal file
166
www/api/test.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
require_once dirname( __FILE__ ) . "/../../lib/bootstrap.php";
|
||||
$session = session::getInstance();
|
||||
|
||||
|
||||
//SPECIAL ZINO
|
||||
ini_set('display_errors','off');
|
||||
ini_set('display_startup_errors','off');
|
||||
ini_set('log_errors','off');
|
||||
//SPECIAL ZINO
|
||||
|
||||
?>
|
||||
<html lang="<?php echo $session->usr_i18n;?>">
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
||||
<style>
|
||||
* {
|
||||
font-family:courier;
|
||||
font-size:14px;
|
||||
}
|
||||
H1 {
|
||||
font-size:20px;
|
||||
background-color:#e0e0e0;
|
||||
margin-top:20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<h1/>identification</h1>
|
||||
|
||||
<form action="./login/login.php" target="RESULT">
|
||||
./login/login.php
|
||||
<input type="checkbox" name="debug" />debug
|
||||
<br/>
|
||||
<textarea name="p" cols="80" rows="6">
|
||||
<?php
|
||||
echo htmlentities(
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<parms action="OPEN_SESSION">
|
||||
<login>api</login>
|
||||
<pwd>api</pwd>
|
||||
</parms>');
|
||||
?>
|
||||
</textarea>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<h1/>preparer un batch</h1>
|
||||
|
||||
<form action="./upload/upload.php" target="RESULT_UPL">
|
||||
./upload/upload.php
|
||||
|
||||
ses_id : <input type="text" value="<?php echo $session->ses_id?>" name="ses_id" />
|
||||
|
||||
usr_id : <input type="text" value="<?php echo $session->usr_id?>" name="usr_id" />
|
||||
|
||||
<input type="checkbox" name="debug" />debug<br/>
|
||||
<textarea name="p" cols="80" rows="6">
|
||||
<?php
|
||||
echo htmlentities(
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<parms action="PREPARE_UPLOAD">
|
||||
<base_id>2</base_id>
|
||||
<nfiles>2</nfiles>
|
||||
</parms>');
|
||||
?>
|
||||
</textarea>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<h1/>envoi par form</h1>
|
||||
|
||||
<form enctype="multipart/form-data" action="./upload/upload.php" target="RESULT_UPL" method="POST">
|
||||
./upload/upload.php
|
||||
|
||||
ses_id : <input type="text" value="<?php echo $session->ses_id?>" name="ses_id" />
|
||||
|
||||
usr_id : <input type="text" value="<?php echo $session->usr_id?>" name="usr_id" />
|
||||
|
||||
<input type="checkbox" name="debug" />debug<br/>
|
||||
file : <input type="file" name="file" /><br/>
|
||||
<textarea name="p" cols="80" rows="10">
|
||||
<?php
|
||||
echo htmlentities(
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<parms action="UPLOAD">
|
||||
<upload_batch_id>???</upload_batch_id>
|
||||
<index>1</index>
|
||||
<filename></filename>
|
||||
<filesize></filesize>
|
||||
<md5></md5>
|
||||
</parms>');
|
||||
?>
|
||||
</textarea>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<h1/>envoi simulé par curl (size, md5,... calculés)</h1>
|
||||
|
||||
<form action="./test_upl.php" target="RESULT_UPL" method="POST">
|
||||
./test_upl.php
|
||||
|
||||
ses_id : <input type="text" value="<?php echo $session->ses_id?>" name="ses_id" />
|
||||
|
||||
usr_id : <input type="text" value="<?php echo $session->usr_id?>" name="usr_id" />
|
||||
<br/>
|
||||
upload_batch_id : <input type="text" value="" name="upload_batch_id" />
|
||||
|
||||
index : <input type="text" value="1" name="index" />
|
||||
|
||||
<input type="checkbox" name="debug" />debug<br/>
|
||||
<?php
|
||||
if( ($o = opendir('./testfiles')) )
|
||||
{
|
||||
$nf = 0;
|
||||
while( ($f = readdir($o)) )
|
||||
{
|
||||
if(substr($f, -4) != '.jpg')
|
||||
continue;
|
||||
echo('<input type="radio" '.($nf==0?'checked':'').' name="file" value="./testfiles/'.$f.'"/>testfiles/'.$f.'<br/>');
|
||||
$nf++;
|
||||
}
|
||||
closedir($o);
|
||||
}
|
||||
?>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<h1/>finir un batch</h1>
|
||||
|
||||
<form action="./upload/upload.php" target="RESULT_UPL">
|
||||
./upload/upload.php
|
||||
|
||||
ses_id : <input type="text" value="<?php echo $session->ses_id?>" name="ses_id" />
|
||||
|
||||
usr_id : <input type="text" value="<?php echo $session->usr_id?>" name="usr_id" />
|
||||
|
||||
<input type="checkbox" name="debug" />debug<br/>
|
||||
<textarea name="p" cols="80" rows="6">
|
||||
<?php
|
||||
echo htmlentities(
|
||||
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<parms action="END_UPLOAD">
|
||||
<upload_batch_id></upload_batch_id>
|
||||
</parms>');
|
||||
?>
|
||||
</textarea>
|
||||
<input type="submit" />
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user