Skip to content

Instantly share code, notes, and snippets.

View yus-ham's full-sized avatar
🌴
On vacation

Yusup Hambali yus-ham

🌴
On vacation
View GitHub Profile
@yus-ham
yus-ham / MultiPartFromStrings.php
Created August 24, 2019 13:05 — forked from iansltx/MultiPartFromStrings.php
Multipart file uploads in PHP from strings
<?php
/**
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile
* type). You can use php://temp to get around this for one file, but if you want to upload
* multiple files then you've got a bit more work.
*
* This function manually constructs the multipart request body from strings and injects it
* into the supplied curl handle, with no need to touch the file system.
@yus-ham
yus-ham / composer.cmd
Last active June 5, 2016 15:47 — forked from JCook21/composer.bat
Quick Batch file to add a 'composer' command to windows.
@echo off
if "%PHPBIN%" == "" set PHPBIN=C:\path\to\php.exe
"%PHPBIN%" "C:\path\to\composer.phar" %*