dojo AJAX file upload demonstration

Form



Status  None
Response Text (formatted)

Objective

The objective of this demonstration/experiment/example was to find a way to upload a file to the server using dojo (AJAX), for integration into a complex LAMP/RIA application.

Key Notes

Credits

Sincere thanks to: dojo Documentation, psychdesktop.net

Server-Side Code

<?php
ini_set('upload_max_filesize','1M');
ini_set('post_max_size','1M');

$sText='';
foreach ($_FILES as $k => $v)
{
$sText.=$k.'\n';
foreach ($v as $kk => $vv)
if ($kk != 'tmp_name')
$sText.=' '.$kk.'='.$vv.'\n';
}
?>
<html>
<head>
<script>isLoaded = true;</script>
</head>
<body>
<textarea>{'status':'Good','textdata':'<?php echo $sText; ?>'}</textarea>
</body>
</html>