I created an image upload form and processed Prototype / PHP.
$('image_upload').observe('submit', function() {
var params = $H();
params.set('name', $('image_title').value);
params.set('from', $('from_who').value);
params.set('upload_file', $('upload_file').value);
new Ajax.Request('/files/upload_process.php', {
method:'post',
parameters: params,
onSuccess: function(r) {
$('uploadbox').update('<img src="/images/interface/thankyou.png" />');
}
})
});
The form itself sends data to the server, but when you try to output, print_r($_FILES['upload_file']);nothing appears, even an empty array.
If I deduce print_r($_POST), the parameters are sent correctly, but only the image file name.
So it seems that the files themselves are not being sent. How can I handle this? thanks rich
source
share