Pisze coś ala skrypt rapidshare chciałbym jednak przesyłać dane na FTP i nie wiem co zrobić gdyż zwraca mi błąd opis na samym dole
Przepraszam za nowy post ale zapomniałem dodać kodu a nie widzę pola edycji
plik html
<script type="text/javascript">
$(document).ready(function() {
$('#uploadForm').submit(function(e) {
if($('#userImage').val()) {
e.preventDefault();
$('#loader-icon').show();
$(this).ajaxSubmit({
target: '#targetLayer',
beforeSubmit: function() {
$("#progress-bar").width('0%');
},
uploadProgress: function (event, position, total, percentComplete){
$("#progress-bar").width(percentComplete + '%');
$("#progress-bar").html('<div id="progress-status">' + percentComplete +'%</div>')
},
success:function (){
$('#loader-icon').hide();
},
resetForm: true
});
return false;
}
});
});
</script>
<center><div id="loader-icon" style="display:none;"><img src="LoaderIcon.gif" /></div></center>
<form id="uploadForm" action="upload.php" method="post">
<div>
<label>Upload Image File:</label>
<input name="userImage" id="userImage" type="file" class="demoInputBox" />
</div>
<div><input type="submit" id="btnSubmit" value="Submit" class="btnSubmit" /></div>
<div id="progress-div"><div id="progress-bar"></div></div>
<div id="targetLayer"></div>
</form>
` `
odbieranie
```php
<?php
if(!empty($_FILES)) {
if(is_uploaded_file($_FILES['userImage']['tmp_name'])) {
$sourcePath = $_FILES['userImage']['tmp_name'];
$targetPath = "uploads/".$_FILES['userImage']['name'];
if(move_uploaded_file($sourcePath,$targetPath)) {
?>
<br><br><br><br>
<div class="container" style="display:block">
<div class="alert alert-success" id="myAlert"">
<a href="#" class="close">×</a>
<strong>PLIK</strong> <?php echo $targetPath; ?>
</div>
</div>
<br>
<?php
}
}
}
?>
no i jak widać próbowałem ładować w funkcji FTP $targetPath z funkcji id_uploadfile ale zwracało błąd dostępu do katalogu tmp