I created this script in livecode but I can't complete the step in php:
Code: Select all
on mouseUp
put empty into tFilePath
answer file "Scegli un file pdf" with type "PDF|pdf"
if it is not empty then
put it into tFileToUpload
set the itemDel to slash
put the last item of tFileToUpload into tFileName
put URL("file:" & tFileToUpload) into tFileContents
post tFileContents to URL "http://10.6.0.153/geco2/upload.php"
end if
end mouseUp
Code: Select all
<?php
$file = $_FILES['tFileContents'];
if ($file['error'] == 0) {
$filename = $file['name'];
$tmpname = $file['tmp_name'];
$destination = "uploads/" . $filename;
if (move_uploaded_file($tmpname, $destination)) {
echo "uploadComplete";
} else {
echo "uploadError";
}
} else {
echo "uploadError";
}
?>