{"id":21470,"date":"2020-08-09T10:35:00","date_gmt":"2020-08-09T10:35:00","guid":{"rendered":"http:\/\/file_upload_with_php"},"modified":"2024-01-08T14:31:47","modified_gmt":"2024-01-08T22:31:47","slug":"file_upload_with_php","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/file_upload_with_php","title":{"rendered":"Uploading PHP Files and Rich Media the Easy Way"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Rich media is surplus and abundant on the internet. Tons of apps these days deal with rich media. Users spend more time uploading and viewing media content than any other thing.<\/p>\n<p><a href=\"https:\/\/cloudinary.com\/documentation\/php_integration\">Cloudinary\u2019s PHP SDK<\/a>, with which you can easily and speedily <a href=\"https:\/\/cloudinary.com\/documentation\/upload_widget\">upload<\/a> multiple images and videos in PHP files can help you ramp up quickly while dealing the mechanics of php <a href=\"https:\/\/cloudinary.com\/blog\/automating_file_upload_and_sharing\">file uploads<\/a> and rich media during app development.<\/p>\n<p>This article guides you through the process of uploading PHP files and rich media the easy way.<\/p>\n<h2>PHP File Uploads With Cloudinary<\/h2>\n<p>The Cloudinary Open-source <a href=\"https:\/\/github.com\/cloudinary\/cloudinary_php\">PHP library<\/a> utilizes the Cloudinary API which allows for the transmission of any kind of file for safe storage in the cloud. They contain easy-to-use helper methods for these image-related tasks:<\/p>\n<ul>\n<li>Uploads<\/li>\n<li>Administration and creation of sprites<\/li>\n<li>Embeddings<\/li>\n<li>Generation of URLs for transformations<\/li>\n<\/ul>\n<p>Before diving into Cloudinary\u2019s specific methods, it\u2019s important to understand the foundational setup for PHP file uploads. This begins with configuring your PHP environment:<\/p>\n<ol>\n<li>\n<strong>Configure the \u201cphp.ini\u201d File:<\/strong> Ensure that the \u201cfile_uploads\u201d parameter is set to \u201cOn\u201d in the \u201cphp.ini\u201d file to enable file uploads.<\/li>\n<li>\n<strong>Create an HTML Form for Upload:<\/strong> In your \u201cindex.html\u201d file, set the form method to POST and the enctype to multipart\/form-data. This form should include a file type input, allowing users to browse and select files for upload.<\/li>\n<\/ol>\n<p>Once the form is submitted, PHP processes the file upload using the <strong>$_FILES<\/strong> superglobal. The file is initially stored in a temporary directory, and you can use PHP\u2019s** move_uploaded_file()** function to move it to a permanent location.<\/p>\n<p>To get started, do the following:<\/p>\n<h3>Step 1. Sign up for a Cloudinary account.<\/h3>\n<p><a href=\"https:\/\/cloudinary.com\/users\/register\/free\">Sign up for Cloudinary\u2019s generous free-tier plan<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res-3.cloudinary.com\/cloudinary\/image\/upload\/w_700,c_fill,f_auto,q_auto,dpr_2.0\/console_dashboard.jpg\" alt=\"Dashboard with upload options\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1400\" height=\"947\"\/>\n<small><strong>Cloudinary Dashboard<\/strong>: Your <strong>cloud name<\/strong>, <strong>API key<\/strong>, and <strong>API secret<\/strong> are the key values for interacting with Cloudinary\u2019s capabilities.<\/small><\/p>\n<h3>Step 2. Install the Cloudinary PHP library.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/image\/upload\/w_700,c_fill,f_auto,q_auto,dpr_2.0\/php_fetch_library.png\" alt=\"Fetch the PHP SDK Library\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1400\" height=\"390\"\/><\/p>\n<p>Fetch the library with Composer. Alternatively, go to <a href=\"https:\/\/github.com\/cloudinary\/cloudinary_php\/tree\/master\/src\">Cloudinary\u2019s PHP repository on GitHub<\/a>, copy all the required files and paste them in your app. Afterwards, then reference them in the script with which to perform the upload, as follows:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JSON \/ JSON with Comments\" data-shcb-language-slug=\"json\"><span><code class=\"hljs language-json shcb-wrap-lines\">\n<span class=\"hljs-comment\">\/**\n** UPLOADING PHP FILES\n***\n\/\/ importing the necessary Cloudinary files\nrequire 'Cloudinary.php';\nrequire 'Uploader.php';\nrequire 'Helpers.php';\nrequire 'Api.php';\n.....\n\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JSON \/ JSON with Comments<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">json<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>To manage your PHP library\u2019s dependency with Composer, install Cloudinary\u2019s PHP library directly from the Packagist repository and update your <code>composer.json<\/code> file, as follows:<\/p>\n<pre class=\"js-syntax-highlighted\"><code>{\n  &quot;require&quot;: {\n    &quot;cloudinary\/cloudinary_php&quot;: &quot;dev-master&quot;\n  }\n}\n<\/code><\/pre>\n<p>Now install the dependencies, including Cloudinary\u2019s PHP package:<\/p>\n<pre class=\"js-syntax-highlighted\"><code>php composer.phar install\n<\/code><\/pre>\n<p>For more details, see <a href=\"https:\/\/cloudinary.com\/documentation\/php_integration#getting_started_guide\">Cloudinary\u2019s documentation on the PHP SDK<\/a>.<\/p>\n<h3>Step 3. PHP File &amp; Rich Media Uploads to Cloudinary.<\/h3>\n<p>You can upload images and other files to Cloudinary in PHP on a server that runs <strong>PHP 5.3<\/strong> or later. Do the following:<\/p>\n<p>First, set up the key values with the <code>config<\/code> method so that Cloudinary can verify that your account is valid:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary::config(<span class=\"hljs-keyword\">array<\/span>(\n    <span class=\"hljs-string\">\"cloud_name\"<\/span> =&gt; <span class=\"hljs-string\">\"my_cloud_name\"<\/span>,\n    <span class=\"hljs-string\">\"api_key\"<\/span> =&gt; <span class=\"hljs-string\">\"my_api_key\"<\/span>,\n    <span class=\"hljs-string\">\"api_secret\"<\/span> =&gt; <span class=\"hljs-string\">\"my_api_secret\"<\/span>\n));\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<div class='c-callout  c-callout--inline-title c-callout--note'><strong class='c-callout__title'>Note:<\/strong> <p>For security, load those three values from an environment (<code>.env<\/code>) file. Alternatively, put them in a file called <code>settings.php<\/code> and include it in the script that performs the actual uploading.<\/p><\/div>\n<p>Now upload your images and other files to <strong>Cloudinary\u2019s cloud platform<\/strong>:<\/p>\n<ul>\n<li>\n<p>To upload a local file, e.g.,<code>my_image.jpg<\/code>, type:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary\\Uploader::upload(<span class=\"hljs-string\">\"\/home\/my_image.jpg\"<\/span>)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The upload method then returns an associative array whose content is similar to this snippet:<\/p>\n<pre class=\"js-syntax-highlighted\"><code>Array\n(\n    [public_id] =&gt; sample\n    [version] =&gt; 1312461204\n    [width] =&gt; 864\n    [height] =&gt; 576\n    [format] =&gt; jpg\n    [bytes] =&gt; 120253\n    [url] =&gt; https:\/\/res.cloudinary.com\/demo\/image\/upload\/v1371281596\/sample.jpg\n    [secure_url] =&gt; https:\/\/res.cloudinary.com\/demo\/image\/upload\/v1371281596\/sample.jpg\n)\n<\/code><\/pre>\n<\/li>\n<li>\n<p>To upload a file from a remote HTTP or HTTPS URL, type:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary\\Uploader::upload(<span class=\"hljs-string\">\"https:\/\/www.example.com\/image.jpg\"<\/span>) \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<\/li>\n<li>\n<p>To upload a file from an S3 bucket, type:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary\\Uploader::upload(<span class=\"hljs-string\">'s3:\/\/my-bucket\/my-path\/my-file.jpg'<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Cloudinary assigns a <strong>public ID<\/strong> to each and every uploaded file for transformation and delivery later on.<\/p>\n<p>Here\u2019s the syntax for uploading files with PHP to Cloudinary:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">upload<\/span><span class=\"hljs-params\">($file, $options = array<span class=\"hljs-params\">()<\/span>)<\/span>\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>See these examples of what you can pass to the <code>$options<\/code> argument:<\/p>\n<\/li>\n<li>\n<p>A custom public ID:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary\\Uploader::upload(<span class=\"hljs-string\">'my_image.jpg'<\/span>, <span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">\"public_id\"<\/span> =&gt; <span class=\"hljs-string\">\"manutd_id\"<\/span>));\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<\/li>\n<li>\n<p>The name of the uploaded file:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary\\Uploader::upload(<span class=\"hljs-string\">'sample.jpg'<\/span>, <span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">\"use_filename\"<\/span> =&gt; <span class=\"hljs-keyword\">TRUE<\/span>));\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<\/li>\n<li>\n<p>An image, a video, or a RAW file:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\\Cloudinary\\Uploader::upload(<span class=\"hljs-string\">\"spreadsheet.xls\"<\/span>, <span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">\"resource_type\"<\/span> =&gt; <span class=\"hljs-string\">\"auto\"<\/span>));\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<\/li>\n<\/ul>\n<p>For details on all the upload options, see the <a href=\"https:\/\/cloudinary.com\/documentation\/image_upload_api_reference#upload\">related Cloudinary documentation<\/a>.<\/p>\n<h2>Conclusion<\/h2>\n<p>Uploading PHP images files to Cloudinary] is hassle free. Once you\u2019ve completed that task, you no longer need to store files on your host server. Do take advantage of dedicated cloud-storage services like Cloudinary, which also performs the invaluable task of serving files securely to web apps through content delivery networks (CDNs).<\/p>\n<hr \/>\n<h2>Want to Learn More About File Uploads?<\/h2>\n<ul>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/automating_file_upload_and_sharing\"><em>Automating File Upload and Sharing<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\"><em>Uploading PHP Files and Rich Media the Easy Way<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_ajax\"><em>AJAX File Upload: Quick Tutorial &amp; Time-Saving Tips<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/impressed_by_whatsapp_technology_build_a_whatsapp_clone_with_image_and_video_upload\"><em>Impressed by WhatsApp? Clone the WhatsApp Technology to Build a File-Upload App on Android<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\"><em>Direct Image Uploads From the Browser to the Cloud With jQuery<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_angular_or_angularjs_to_cloudinary\"><em>File Upload With Angular to Cloudinary<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/uploading_vue_files_and_rich_media_in_two_easy_steps\"><em>Uploading Vue Files and Rich Media in Two Easy Steps<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/node_js_file_upload_to_a_local_server_or_to_the_cloud\"><em>Node.js File Upload to a Local Server Or to the Cloud<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/laravel_file_upload_to_a_local_server_or_to_the_cloud\"><em>Laravel File Upload to a Local Server Or to the Cloud<\/em><\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/blog\/javascript_file_upload_to_cloudinary\"><em>JavaScript File Upload in Two Simple Steps<\/em><\/a>\n<\/li>\n<\/ul>\n<\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":21471,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[119,229,263],"class_list":["post-21470","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-file-upload","tag-php","tag-sdk"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Uploading PHP Files and Rich Media the Easy Way<\/title>\n<meta name=\"description\" content=\"Learn how to upload PHP files and rich media, including images, videos, and audio, with Cloudinary\u2019s free API.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Uploading PHP Files and Rich Media the Easy Way\" \/>\n<meta property=\"og:description\" content=\"Learn how to upload PHP files and rich media, including images, videos, and audio, with Cloudinary\u2019s free API.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-09T10:35:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-08T22:31:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"1540\" \/>\n\t<meta property=\"og:image:height\" content=\"1026\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Uploading PHP Files and Rich Media the Easy Way\",\"datePublished\":\"2020-08-09T10:35:00+00:00\",\"dateModified\":\"2024-01-08T22:31:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\"},\"wordCount\":9,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA\",\"keywords\":[\"File-upload\",\"PHP\",\"SDK\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2020\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\",\"url\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\",\"name\":\"Uploading PHP Files and Rich Media the Easy Way\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA\",\"datePublished\":\"2020-08-09T10:35:00+00:00\",\"dateModified\":\"2024-01-08T22:31:47+00:00\",\"description\":\"Learn how to upload PHP files and rich media, including images, videos, and audio, with Cloudinary\u2019s free API.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA\",\"width\":1540,\"height\":1026},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/file_upload_with_php#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Uploading PHP Files and Rich Media the Easy Way\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Uploading PHP Files and Rich Media the Easy Way","description":"Learn how to upload PHP files and rich media, including images, videos, and audio, with Cloudinary\u2019s free API.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/file_upload_with_php","og_locale":"en_US","og_type":"article","og_title":"Uploading PHP Files and Rich Media the Easy Way","og_description":"Learn how to upload PHP files and rich media, including images, videos, and audio, with Cloudinary\u2019s free API.","og_url":"https:\/\/cloudinary.com\/blog\/file_upload_with_php","og_site_name":"Cloudinary Blog","article_published_time":"2020-08-09T10:35:00+00:00","article_modified_time":"2024-01-08T22:31:47+00:00","og_image":[{"width":1540,"height":1026,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php"},"author":{"name":"","@id":""},"headline":"Uploading PHP Files and Rich Media the Easy Way","datePublished":"2020-08-09T10:35:00+00:00","dateModified":"2024-01-08T22:31:47+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php"},"wordCount":9,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA","keywords":["File-upload","PHP","SDK"],"inLanguage":"en-US","copyrightYear":"2020","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php","url":"https:\/\/cloudinary.com\/blog\/file_upload_with_php","name":"Uploading PHP Files and Rich Media the Easy Way","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA","datePublished":"2020-08-09T10:35:00+00:00","dateModified":"2024-01-08T22:31:47+00:00","description":"Learn how to upload PHP files and rich media, including images, videos, and audio, with Cloudinary\u2019s free API.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/file_upload_with_php"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA","width":1540,"height":1026},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/file_upload_with_php#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Uploading PHP Files and Rich Media the Easy Way"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649720213\/Web_Assets\/blog\/php_upload_cover_blog\/php_upload_cover_blog.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=21470"}],"version-history":[{"count":12,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21470\/revisions"}],"predecessor-version":[{"id":32585,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21470\/revisions\/32585"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/21471"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=21470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=21470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=21470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}