Skip to content

Instantly share code, notes, and snippets.

View alejandroivan's full-sized avatar

Alejandro Iván Melo Domínguez alejandroivan

View GitHub Profile
@alejandroivan
alejandroivan / ViewController.swift
Created January 8, 2018 15:14
[Swift4-iOS] Convertir video a MP4 y enviarlo servidor web mediante multipart/form-data (Alamofire)
import AVFoundation
import Photos
import Alamofire
class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
let imagePicker = UIImagePickerController()
@alejandroivan
alejandroivan / attachment.php
Last active August 23, 2020 03:09
PHP output contents of file
<?php
$file_path = "/full/path/of/the/file.doc";
if ( file_exists($file_path) ) {
$file_name = basename($file_path);
$mime_type = mime_content_type($file_path);
$file_size = filesize($file_path);
header('Content-Description: File Transfer');
header("Content-Type: {$mime_type}");
header("Content-Disposition: attachment; filename=\"{$file_name}\"");