nie chce mi wgrywać plików jeżeli skrypt wgrywający pliki jest w jednej z akcji:
public function uploadAction() { //action body $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; // $fileTypes = str_replace('*.','',$_REQUEST['fileext']); // $fileTypes = str_replace(';','|',$fileTypes); // $typesArray = split('\|',$fileTypes); // $fileParts = pathinfo($_FILES['Filedata']['name']); // if (in_array($fileParts['extension'],$typesArray)) { // Uncomment the following line if you want to make the directory if it doesn't exist // mkdir(str_replace('//','/',$targetPath), 0755, true); // } else { // echo 'Invalid file type.'; // } } }
admin.phtml
Kod
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '<?php echo $this->baseUrl().'/upload'; ?>',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/../../../uploads',
'auto' : true
});
});
// ]]>
</script>
// <![CDATA[
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '<?php echo $this->baseUrl().'/upload'; ?>',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/../../../uploads',
'auto' : true
});
});
// ]]>
</script>
Natomiast jeśli ustawię wgrywanie z pliku i zmienię ścieżkę do folderu docelowego wszystko jest ok proszę o pomoc. Z góry dzięki.:
admin.phtml
Kod
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/uploadify/uploadify.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/uploads',
'auto' : true
});
});
// ]]>
</script>
// <![CDATA[
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/uploadify/uploadify.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/uploads',
'auto' : true
});
});
// ]]>
</script>