Skip to content

Instantly share code, notes, and snippets.

View hyuzea's full-sized avatar
🌴
On vacation

Yusup Hambali hyuzea

🌴
On vacation
  • @Saung-Rangon
  • Purabaya (Jampang Area), Sukabumi Selatan
View GitHub Profile
@hyuzea
hyuzea / 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.
@hyuzea
hyuzea / 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" %*