Skip to content

Instantly share code, notes, and snippets.

View AmineMx's full-sized avatar
🏠
Working from home

Amine Kaddache AmineMx

🏠
Working from home
View GitHub Profile
router.post('/userpicture/:id', upload.array('avatar', 6), (req, res, next) => {
const url = req.protocol + '://' + req.get('host');
const fileUploads = [];
for (var i = 0; i < req.files.length; i++) {
const link = url + '/public/' + req.files[0].filename;
@AmineMx
AmineMx / upload.php
Last active January 14, 2018 19:47 — forked from gayanhewa/upload.php
PHP Script to upload files via FTP
<?php
ini_set('max_execution_time', 3000);
// Ref : http://php.net/manual/en/function.ftp-put.php
$name = "test.txt";
$filename = "/home/mine/Desktop/test.txt";
//-- Code to Transfer File on Server Dt: 06-03-2008 by Aditya Bhatt --//
//-- Connection Settings
$ftp_server = "server_url_here"; // Address of FTP server.