Posts

Showing posts with the label upload

Upload files into SFTP server using PHP

Image
Clash Royale CLAN TAG #URR8PPP Upload files into SFTP server using PHP This is my first time using sftp, and I'm stuck "This was pedictable"...I have a csv file dowloanded via web browser into my Downloads Directory using a "Webservice" permetting such thing, and I wanna upload this file into a sftp server. I've tried many codes that I've found here or on other websites but none of them worked. Here is two examples of codes I tried to run: FISRT EXAMPLE: <?php $ftp_server = 'example.server.net'; // Address of FTP server. $ftp_user_name = 'username'; // Username $ftp_user_pass = 'password'; // Password $destination_file = "serverpath"; //where you want to throw the file on the webserver (relative to your login dir) $conn_id = ftp_connect($ftp_server,22) or die("<span style='color:#FF0000'> <h2>Couldn't connect to $ftp_server</h2></span>"); //set up basic connection $login_r...

Need help to make php upload only accept zip, rar and swf

Image
Clash Royale CLAN TAG #URR8PPP Need help to make php upload only accept zip, rar and swf Im currently developing an PHP File Uploader, however I only want the file uploader to accept zip, rar and swf files. I've tried everything but it doesn't work, here is my code. When im uploading for example and zip file im just getting my own upload error. Upload.html <head> <link href="favicon.png" rel="shortcut icon" type="image/x-icon"/> <!-- Compiled and minified CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/css/materialize.min.css"> <link rel="stylesheet" href="pageloader.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <!-- Compiled and minified JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1....