/** * Display a listing of the resource. * * @return Response */ public function index() { $status = FTP::connection()->makeDir('/laravel'); $status = FTP::connection()->makeDir('/laravel/newdir'); $status = FTP::connection()->makeDir('/laravel/newdir2'); $listing = FTP::connection()->getDirListing('/laravel'); dd($listing); }
* */ Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']); //Tests Route::get('admin/mibor_buyers', 'RetsController@buyerQuery'); Route::get('admin/mibor_sellers', 'RetsController@sellerQuery'); Route::get('admin/mibor_sellers/{office}/{start}/{end}', 'RetsController@sellerQuery'); Route::get('admin/mibor_buyers/{office}/{start}/{end}', 'RetsController@buyerQuery'); Route::get('admin/mibor_test/{agent_id}/{start_range}/{end_range}', 'RetsController@test'); Route::get('test', function () { // $user = \App\C21\Users\User::where('id',1)->with('groups')->first(); //dd($user->groups[0]->name); return view('emails.email_1'); }); Route::get('admin/ftp', function () { $listing = FTP::connection()->downloadFile('Agents.xml', storage_path() . '/c21/Agents.xml'); if ($listing === true) { return redirect('admin/agents_go'); } die('The file failed for some reason'); }); Route::get('webvideos/{video}', function ($video) { $random = rand(1, 1); $video_path = base_path('public/videos') . '/folder_' . $random . '/' . $video; $stream = new \App\Videos\VideoStream($video_path); $stream->start(); }); Route::get('video', function () { return view('tests/video'); }); Route::get('admin/agents_go', function () {
private function revert($facturas) { $ftpConnection = \FTP::connection(); foreach ($facturas as $factura) { $numFac = $factura["num_factura"]; $ejercicio = $factura["ejercicio"]; $pdfName = $factura["file_pdf"]; FacturasWeb::where("num_factura", $numFac)->where("ejercicio", $ejercicio)->delete(); $ftpConnection->delete("clientes.logival.es/facturas/{$pdfName}"); } \FTP::disconnect(); }
<?php /** * Permet d'uploader le fichier envoyé */ // Includes require_once '../config.php'; require_once 'filefolder.class.php'; require_once 'ftp.class.php'; require_once 'upload.class.php'; // Variables if (isset($_GET['path'])) { $path = $_GET['path']; } else { $path = null; } // Connexion $link = FTP::connection(); // Fonction de rappel pour le remplacement des caractères spéciaux function replaceFilename($str) { return stripslashes(FileFolder::replaceSpecificChars($str, true)); } // Enregistrement du fichier sur le FTP echo FileUploader::saveUploadedFileToFTP($link, $path, false, $_CONFIG['upload_allowed_extensions'], $_CONFIG['upload_size_limit'] * 1024 * 1024, 'replaceFilename'); // Déconnexion FTP::disconnection($link);