Zaloguj | Zarejestruj | FAQ
Anonymous

Php Uploader

+ Odpowiedz

Posty: 3 Strona 1 z 1


Php Uploader

przez Chikwado » N mar 15, 2015 6:09 am

Ostatnio edytowano Pn mar 23, 2015 11:39 am przez Chikwado, łącznie edytowano 2 razy

Avatar użytkownika

Chikwado

  • Posty: 94
  • Dołączył(a): Pn lip 29, 2013 11:36 pm
  • Lokalizacja: Nigeria
--
Focus On Advance Science And Programming.

Re: Php Uploader

przez brata123456789 » N mar 22, 2015 10:25 am

<?php
$ftp_server = "XXXXXXXXX"; // Address of FTP Server
$ftp_user_name = "XXXXXXXXXX"; // Username
$ftp_user_pass = "XXXXXXXXXXXX"; // Password
// Locations and others
$remote_dir = "/www_root/uploaded_files";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

$file_url = "";
if($login_result) {
//set passive mode enabled
ftp_pasv($conn_id, true);


if ($file == "")
{
echo
"<script type=\"text/javascript\">".
"window.alert('You havent chosed file');".
"top.location = 'index.html';".
"</script>";


exit;
}
$file = $_FILES["file"]["tmp_name"];
$remote_file = $_FILES["file"]["name"];

$ret = ftp_nb_put($conn_id, $remote_file, $file, FTP_BINARY, FTP_AUTORESUME);
while(FTP_MOREDATA == $ret) {
$ret = ftp_nb_continue($conn_id);
}
if($ret == FTP_FINISHED) {
echo
"<script type=\"text/javascript\">".
"window.alert('File uploaded');".
"top.location = 'index.html';".
"</script>";

} else {
echo
"<script type=\"text/javascript\">".
"window.alert('Upload was not succesful');".
"top.location = 'index.html';".
"</script>";
}
}
?>


My php script.. Just copy paste it , ..
$ftp_server = "XXXXXXXXX"; / - here u must enter your ftp server name ( instead of XXXXX)
$ftp_user_name = "XXXXXXXXXX"; // here u must enter your ftp server username
$ftp_user_pass = "XXXXXXXXXXXX"; -----------.. u know what to do
Avatar użytkownika

brata123456789

  • Posty: 2
  • Dołączył(a): Pt mar 20, 2015 9:29 pm

Re: Php Uploader

przez Chikwado » Cz mar 26, 2015 7:40 pm

Avatar użytkownika

Chikwado

  • Posty: 94
  • Dołączył(a): Pn lip 29, 2013 11:36 pm
  • Lokalizacja: Nigeria
--
Focus On Advance Science And Programming.


+ Odpowiedz

Strona 1 z 1