{"id":21150,"date":"2012-08-28T10:32:23","date_gmt":"2012-08-28T10:32:23","guid":{"rendered":"http:\/\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery"},"modified":"2024-05-31T17:44:21","modified_gmt":"2024-06-01T00:44:21","slug":"direct_image_uploads_from_the_browser_to_the_cloud_with_jquery","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery","title":{"rendered":"Direct Image Uploads From the Browser to the Cloud With jQuery"},"content":{"rendered":"<p>Where do you host all of your website&#8217;s assets &#8211; still on your own web servers?<\/p>\n<p>In modern websites, images alone contribute to more than 50% of a website\u2019s load time, and recent studies show that even a 1 second delay in a page&#8217;s load speed can result in more than 5% loss in conversion. The impact of correctly delivering your website&#8217;s images to your viewers is staggering. Luckily, <a href=\"https:\/\/cloudinary.com\" target=\"_blank\" rel=\"noopener\">Cloudinary<\/a>\u00a0offers a simple way to <a title=\"File Upload\" href=\"https:\/\/cloudinary.com\/blog\/automating_file_upload_and_sharing\" target=\"_blank\" rel=\"noopener\">upload<\/a> your website&#8217;s images to the cloud, automatically transform them according to your needs and deliver them optimized through a fast CDN employing industry best practices.<\/p>\n<p>In recent posts we&#8217;ve covered how to simply move your website&#8217;s assets, either static or dynamic to Cloudinary. In this post, we wanted to detail how you can upload photos to Cloudinary directly from your users&#8217; browsers, without going through your own servers in the process. Below you will find a general explanation of our direct uploading solution, detailed integration examples and advanced tips.<\/p>\n<div>\n<h3>Uploading images directly to the cloud<\/h3>\n<p>The common way of uploading images from your web application to the cloud involves a form in your application that uploads an image to your server that in turn uploads the same image to the cloud.<\/p>\n<p>While this approach works, you might want to consider a more direct approach &#8211; <span style=\"color: #bb0000;\"><strong>delivering images directly from your users&#8217; browser to the cloud without going through your intermediary server<\/strong><\/span>.<\/p>\n<p>This approach is faster as it eliminates redundant <a href=\"https:\/\/cloudinary.com\/blog\/automating_file_upload_and_sharing\" target=\"_blank\" rel=\"noopener\">file uploads<\/a>, it reduces load on your servers and it bypasses common limitations of shared web hosting (e.g. maximum size of allowed uploaded data, maximum number of concurrent requests to your application, etc.). In addition, the approach we detail below is simple to integrate with modern web browsers and includes many modern uploading UI elements such as drag &amp; drop support, showing uploading progress, multiple file uploads support and more.<\/p>\n<\/div>\n<h3>Direct uploading to Cloudinary<\/h3>\n<p>Cloudinary&#8217;s service supports direct uploading to the cloud out-of-the-box.<br \/>\n<img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin: 5px 10px 5px 10px;\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_0.5\/mpshcbcqxrkrq2q16cl6aw.png\" alt=\"\" width=\"150\" height=\"37\" \/>The process is based on <strong><a href=\"https:\/\/github.com\/cloudinary\/cloudinary_js\" target=\"_blank\" rel=\"noopener\">Cloudinary&#8217;s jQuery plugin<\/a><\/strong> which in turn includes upload support based on <strong><a href=\"https:\/\/github.com\/blueimp\/jQuery-File-Upload\" target=\"_blank\" rel=\"noopener\">jQuery File Upload Plugin<\/a><\/strong>, one of todays leading file upload solutions. Direct uploading is done using modern HTML5 cross origin resource sharing (<strong><a href=\"http:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing\" target=\"_blank\" rel=\"noopener\">CORS<\/a><\/strong>) and gracefully degrades to a seamless iframe based solution for older browsers.<br \/>\nTo get the Cloudinary upload solution working, we will go through the following steps (detailed more granularly later on):<\/p>\n<ul>\n<li>Generate an authentication signature on your server side, in your web development framework of choice.<\/li>\n<li>Include Cloudinary&#8217;s jQuery plugin.<\/li>\n<li>Add Cloudinary\u2019s special attributes to your file input tag in your HTML image upload form.<\/li>\n<\/ul>\n<p>That\u2019s basically it. Your visitors will now be able to upload images using drag-and-drop support (or regular browsing) and images will be uploaded directly to Cloudinary with a progress bar support.<br \/>\nWhen the upload is complete, your image&#8217;s Cloudinary public ID will be added to your original form and submitted to your server. Use this public ID when you want to access the uploaded image in the future, either in its original form or after using Cloudinary&#8217;s on-demand image transformations. You can also get the plugin to call a Javascript callback routine when uploading to Cloudinary is completed.<br \/>\nWith our client libraries, setting up direct image uploads to Cloudinary is even simpler. Below are integration instructions for Ruby on Rails, Python \/ Django and other web dev platforms.<br \/>\n<strong>UPDATE &#8211; July 2014<\/strong>: A simpler solution for direct uploading to the cloud, without server-side signature, was introduced. See\u00a0<a href=\"https:\/\/cloudinary.com\/blog\/direct_upload_made_easy_from_browser_or_mobile_app_to_the_cloud\">Direct upload made easy, from browser or mobile app to the cloud<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_0.5\/dlkljlg1rzl8yo7th7wfhq.png\" alt=\"\" width=\"43\" height=\"55\" \/><\/p>\n<h3 style=\"line-height: 55px;\">Ruby on Rails Integration<\/h3>\n<p>Setting up direct uploads from your Rails application is quite simple. Here is a detailed explanation:<br \/>\n<span style=\"color: #bb0000;\"><strong>1.<\/strong><\/span>\u00a0Make sure you use the latest version of Cloudinary\u2019s Ruby GEM.<br \/>\n<span style=\"color: #bb0000;\"><strong>2.<\/strong><\/span>\u00a0Place <em><strong>cloudinary_cors.html<\/strong><\/em> in the public folder of your Rails app.\u00a0The file is available in the <em><strong>vendor\/assets\/html<\/strong><\/em> folder of the Ruby GEM.<br \/>\n<span style=\"color: #bb0000;\"><strong>3.<\/strong><\/span>\u00a0Make sure to include the relevant jQuery plugins in your view.\u00a0They are located in the <em><strong>vendor\/assets\/javascripts<\/strong><\/em>folder of the Ruby GEM.<\/p>\n<pre>&lt;%= javascript_include_tag \"jquery.ui.widget\", \"jquery.iframe-transport\", \n                           \"jquery.fileupload\", \"jquery.cloudinary\" %&gt;\n<\/pre>\n<p>Alternatively, If you use Asset Pipeline, \u00a0simply edit your application.js and add the following line:<\/p>\n<pre>\/\/= require cloudinary<\/pre>\n<p><span style=\"color: #bb0000;\"><strong>4.<\/strong><\/span>\u00a0Add the Cloudinary configuration parameters to your view:<\/p>\n<pre>&lt;%= cloudinary_js_config %&gt;<\/pre>\n<p><span style=\"color: #bb0000;\"><strong>5.<\/strong><\/span>\u00a0Add <em><strong>cl_image_upload_tag<\/strong><\/em>to a form in your view.\u00a0This tag adds a file input element that is already configured to use direct uploading. In this example, we also perform an incoming transformation (limit to 1000&#215;1000) and add a custom class to the HTML element:<\/p>\n<pre>&lt;%= form_tag(some_path, :method =&gt; :post) do \u00a0%&gt;\n  &lt;%= cl_image_upload_tag(:image_id, :crop =&gt; :limit, :width =&gt; 1000, :height =&gt; 1000, \n                          :html =&gt; {:class =&gt; \"image_upload\"}) %&gt;\n\u00a0 \u00a0 ...\n&lt;%= end %&gt;\n<\/pre>\n<p>This is it if you use <strong>CarrierWave<\/strong> for managing your image uploads in your Rails application, together with <a href=\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\" target=\"_blank\" rel=\"noopener\">Cloudinary\u2019s plugin for CarrierWave<\/a>\u00a0(recommended).<\/p>\n<p>Another great option is to use the <a href=\"https:\/\/github.com\/assembler\/attachinary\" target=\"_blank\" rel=\"noopener\"><strong>Attachinary GEM<\/strong><\/a>\u00a0developed by Milovan Zogovic. Direct uploading to Cloudinary comes out of the box with Attachinary.<\/p>\n<p>If you use uploading without CarrierWave or Attachinary, one last step is required &#8211; extracting the public ID and version of the uploaded image when the form is submitted to your controller:<\/p>\n<pre>\u00a0 if @params[:image_id].present?\n\u00a0 \u00a0 \u00a0preloaded = Cloudinary::PreloadedFile.new(params[:image_id])\n\u00a0 \u00a0 \u00a0# Verify signature by calling preloaded.valid?\n\u00a0 \u00a0 \u00a0@model.image_id = preloaded.identifier\n\u00a0 end\n<\/pre>\n<p>Having stored the image_id, you can now display a directly uploaded image in the same way your display any other Cloudinary hosted image:<\/p>\n<pre>&lt;%= cl_image_tag(@model.image_id, :crop =&gt; :fill, :width =&gt; 120, :height =&gt; 80) %&gt;\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"https:\/\/res.cloudinary.com\/cloudinary\/image\/upload\/w_0.08\/kiblgce0r9sxpcacnyzxlq.png\" alt=\"\" width=\"96\" height=\"33\" \/><\/p>\n<h3 style=\"line-height: 34px;\">Python &amp; Django Integration<\/h3>\n<p>Setting up direct uploads from your Django application is quite similar to the RoR approach. Here is a detailed explanation:<\/p>\n<p><span style=\"color: #bb0000;\"><strong>1.<\/strong><\/span>\u00a0Make sure you use Cloudnary\u2019s latest Python library.<\/p>\n<p><span style=\"color: #bb0000;\"><strong>2.<\/strong><\/span>\u00a0In your Django template, load Cloudinary and include jQuery and all relevant jQuery plugins:<\/p>\n<pre>{% load cloudinary %}\n{% load staticfiles %}\n&lt;script src=\"{% static \"js\/jquery.js\" %}\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\n{% cloudinary_includes %}<\/pre>\n<p><span style=\"color: #bb0000;\"><strong>3.<\/strong><\/span>\u00a0Add a file uploading tag to your form:<\/p>\n<pre>&lt;form action=\"\/posts\/save\" method=\"post\"&gt;\n\u00a0 {% csrf_token %}\n\u00a0 {{ form.image }}\n\u00a0 &lt;input type=\"submit\" value=\"Submit\" \/&gt;\n&lt;\/form&gt;<\/pre>\n<p><span style=\"color: #bb0000;\"><strong>4.<\/strong><\/span>\u00a0Edit your <em><strong>views.py<\/strong><\/em> and define the image form field as a <em><strong>CloudinaryJsFileField<\/strong><\/em> instance.\u00a0This class does all the behind-the-scenes magic for you. In the example below, the dummy save action receives the uploaded image.<\/p>\n<pre>from django import forms\nimport cloudinary, cloudinary.uploader, cloudinary.forms\n\nclass UploadFileForm(forms.Form):\n    image  = cloudinary.forms.CloudinaryJsFileField()\n\ndef save(request):\n    form = UploadFileForm(request.POST)\n    cloudinary.forms.cl_init_js_callbacks(form, request)\n    if request.method == 'POST':\n        if form.is_valid():\n            image = form.cleaned_data['image']\n            return HttpResponseRedirect(image.url())\n    return render_to_response('posts\/upload.html', \n                              RequestContext(request, {'form': form, 'post': p}))\n<\/pre>\n<h3>Other development frameworks and advanced usage<\/h3>\n<p>In the examples above, we&#8217;ve shown detailed integration instructions based on Cloudinary\u2019s Ruby and Python client libraries. The same integration concept can be used together with our <strong>PHP<\/strong> library using the cloudinary_js_config and cl_image_upload_tag methods.<\/p>\n<p>We will soon enhance our documentation to include detailed instructions for direct Cloudinary uploads using all of our other client libraries.<\/p>\n<p>In the meantime, following are detailed instructions on how to use direct uploading in your development environment without our client libraries, using Cloudinary\u2019s jQuery plugin directly.<\/p>\n<p><span style=\"color: #bb0000;\"><strong>1.<\/strong><\/span> Include jQuery and the following jQuery plugins in your HTML page:<\/p>\n<p><em><strong>jquery.js, jquery.ui.widget.js, jquery.iframe-transport.js, jquery.fileupload.js, jquery.cloudinary.js<\/strong><\/em><\/p>\n<p><span style=\"color: #bb0000;\"><strong>2.<\/strong><\/span>\u00a0Define your account\u2019s Cloudinary configuration. Note that only public parameters are included (secrets must not be included in public HTML pages or client-side Javascript code):<\/p>\n<pre>&lt;script type=\"text\/javascript\"&gt;\n   $.cloudinary.config({\"api_key\":\"1234567890\",\"cloud_name\":\"demo\"});\n&lt;\/script&gt;<\/pre>\n<p><span style=\"color: #bb0000;\"><strong>3.<\/strong><\/span>\u00a0Add a file input field to your HTML form.<\/p>\n<ul>\n<li>Set the <em><strong>class<\/strong><\/em> name to &#8216;<em><strong>cloudinary-fileupload<\/strong><\/em>&#8216; (alternatively, selection of input fields can be done programmatically).<\/li>\n<li>Set <em><strong>data-cloudinary-field<\/strong><\/em> to the name of the input field that should contain the upload reference.<\/li>\n<li>Set <em><strong>data-form-data<\/strong><\/em> to be JSON representation of the upload API params. The mandatory fields are <em><strong>api_key<\/strong><\/em>, <em><strong>timestamp<\/strong><\/em>, <em><strong>signature<\/strong><\/em> and <em><strong>callback<\/strong><\/em>. Any additional incoming or eager transformation parameters <a href=\"https:\/\/cloudinary.com\/documentation\/transformations_on_upload\" target=\"_blank\" rel=\"noopener\">can be specified<\/a>.\n<ul>\n<li>The <em><strong>signature<\/strong><\/em> needs to be generated on the server-side for correct authentication.<\/li>\n<li>The <em><strong>callback<\/strong><\/em> should point to a public URL of your web application that has the cloudinary_cors.html file. It is included in our jQuery plugin package and is required for iframe fallback upload.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>For example:<\/p>\n<pre>&lt;input name=\"file\" type=\"file\" \n       class=\"cloudinary-fileupload\" data-cloudinary-field=\"image_upload\" \n       data-form-data=\" ... html-escaped JSON data ... \" &gt;&lt;\/input&gt;\n<\/pre>\n<p>The unescaped JSON content of data-form-data is:<\/p>\n<pre>{ \"timestamp\":  1345719094, \n  \"callback\": \"https:\/\/www.example.com\/cloudinary_cors.html\",\n  \"signature\": \"7ac8c757e940d95f95495aa0f1cba89ef1a8aa7a\", \n  \"api_key\": \"1234567890\" }\n<\/pre>\n<p>That&#8217;s it. Image uploads by either browsing or drag-and-drop will head straight to the Cloudinary service. When done, the reference (public ID, version and signature) will be saved in the field you requested, for storing in your model at the server side.<\/p>\n<p>You can also listen to various events in your Javascript code. For example:<\/p>\n<ul>\n<li><em><strong>fileuploadstart<\/strong><\/em> &#8211; useful for showing a progress indicator when the upload starts.<\/li>\n<li><em><strong>fileuploadfail<\/strong><\/em> &#8211; listen to this event if you want to show an error message if an upload fails.<\/li>\n<li><em><strong>cloudinarydone<\/strong><\/em> &#8211; sent when upload completes. Following is a code example that displays a Cloudinary dynamically generated thumbnail of the previously uploaded image:<\/li>\n<\/ul>\n<pre>$('.cloudinary-fileupload').bind('cloudinarydone', function(e, data) {\n  $('.preview').html(\n       $.cloudinary.image(data.result.public_id, \n           { format: data.result.format, version: data.result.version, \n             crop: 'scale', width: 200 }));    \n       $('.image_public_id').val(data.result.public_id);    \n  return true;\n});<\/pre>\n<h3>Fancy upload UI<\/h3>\n<p>Modern websites frequently use fancy upload widgets that include progress bars, live previews, multiple file uploads and more. The approach we\u2019&#8217;e shown above can be easily customized and extended to feature all of these advanced capabilities. Together with Cloudinary&#8217;s jQuery plugin, these great looking file upload widgets can upload your user&#8217;s photos directly to Cloudinary, generate preview thumbnails on-the-fly and deliver the resulting photos from a fast CDN.<\/p>\n<p>Direct uploading is a powerful feature that many of our readers requested. Try it out and tell us what you think?<\/p>\n<p>If you have a cool code sample in any development framework with or without a fancy UI, <strong><a href=\"mailto:info@cloudinary.com?subject=Sample+code+to+share\">share it with our community<\/a><\/strong> and we will give you a generous one year discount for any of Cloudinary\u2019s paid plans.<\/p>\n<p><strong>UPDATE &#8211; July 2014<\/strong>: A simpler solution for direct uploading to the cloud, without server-side signature, was introduced. See\u00a0<a href=\"https:\/\/cloudinary.com\/blog\/direct_upload_made_easy_from_browser_or_mobile_app_to_the_cloud\">Direct upload made easy, from browser or mobile app to the cloud<\/a>.<\/p>\n<h3 style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><strong><span style=\"font-size: 11pt; font-family: Arial; color: #000000; background-color: #ffffff; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;\">Further Reading on File Upload<\/span><\/strong><\/h3>\n<ul style=\"font-size: 14px; font-weight: 400;\">\n<li><span style=\"font-family: Arial; font-size: 11pt;\"><a title=\"File Upload\" href=\"https:\/\/cloudinary.com\/blog\/automating_file_upload_and_sharing\" target=\"_blank\" rel=\"noopener\">File upload and storage<\/a> with Cloudinary<\/span><\/li>\n<li><a title=\"PHP File upload\" href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\" target=\"_blank\" rel=\"noopener\">PHP file upload<\/a>\u00a0with Cloudinary<\/li>\n<li><span style=\"font-family: Arial; font-size: 11pt;\"><a title=\"AJAX File upload\" href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_ajax\" target=\"_blank\" rel=\"noopener\">AJAX file upload<\/a> &#8211; Quick tutorial &amp; time saving Tips<\/span><\/li>\n<li><a title=\"Android file upload\" href=\"https:\/\/cloudinary.com\/blog\/impressed_by_whatsapp_technology_build_a_whatsapp_clone_with_image_and_video_upload\" target=\"_blank\" rel=\"noopener\">Android file upload<\/a>&#8211; Clone WhatsApp technology using Cloudinary<\/li>\n<li><a title=\"jQuery image upload\" href=\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\" target=\"_blank\" rel=\"noopener\">jQuery image upload<\/a>\u00a0plugin<\/li>\n<li><a title=\"Angular File Upload\" href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_angular_or_angularjs_to_cloudinary\" target=\"_blank\" rel=\"noopener\">Angular file upload<\/a> with Cloudinary<\/li>\n<li><a title=\"Vue file upload\" href=\"https:\/\/cloudinary.com\/blog\/uploading_vue_files_and_rich_media_in_two_easy_steps\" target=\"_blank\" rel=\"noopener\">Vue file upload<\/a> with Cloudinary<\/li>\n<li><a title=\"Node.js file upload\" href=\"https:\/\/cloudinary.com\/blog\/node_js_file_upload_to_a_local_server_or_to_the_cloud\" target=\"_blank\" rel=\"noopener\">Node.js file upload<\/a> with Cloudinary<\/li>\n<li><a title=\"Laravel file upload\" href=\"https:\/\/cloudinary.com\/blog\/laravel_file_upload_to_a_local_server_or_to_the_cloud\" target=\"_blank\" rel=\"noopener\">Laravel file upload<\/a> with Cloudinary<\/li>\n<li><a title=\"Javascript file upload\" href=\"https:\/\/cloudinary.com\/blog\/javascript_file_upload_to_cloudinary\" target=\"_blank\" rel=\"noopener\">Javascript file upload<\/a> with Cloudinary<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Where do you host all of your website&#8217;s assets &#8211; still on your own web servers? In modern websites, images alone contribute to more than 50% of a website\u2019s load time, and recent studies show that even a 1 second delay in a page&#8217;s load speed can result in more than 5% loss in conversion. [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":23366,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[91,119,183,257],"class_list":["post-21150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-django","tag-file-upload","tag-jquery","tag-ruby-on-rails"],"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>Upload Images with jQuery From the Browser to the Cloud<\/title>\n<meta name=\"description\" content=\"Learn how to directly uploads images with jQuery from your browser to the cloud without going through your intermediary server.\" \/>\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\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Direct Image Uploads From the Browser to the Cloud With jQuery\" \/>\n<meta property=\"og:description\" content=\"Learn how to directly uploads images with jQuery from your browser to the cloud without going through your intermediary server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2012-08-28T10:32:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-01T00:44:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1100\" \/>\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\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Direct Image Uploads From the Browser to the Cloud With jQuery\",\"datePublished\":\"2012-08-28T10:32:23+00:00\",\"dateModified\":\"2024-06-01T00:44:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\"},\"wordCount\":1569,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA\",\"keywords\":[\"Django\",\"File-upload\",\"jQuery\",\"Ruby on Rails\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2012\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\",\"url\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\",\"name\":\"Upload Images with jQuery From the Browser to the Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA\",\"datePublished\":\"2012-08-28T10:32:23+00:00\",\"dateModified\":\"2024-06-01T00:44:21+00:00\",\"description\":\"Learn how to directly uploads images with jQuery from your browser to the cloud without going through your intermediary server.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA\",\"width\":2000,\"height\":1100},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Direct Image Uploads From the Browser to the Cloud With jQuery\"}]},{\"@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":"Upload Images with jQuery From the Browser to the Cloud","description":"Learn how to directly uploads images with jQuery from your browser to the cloud without going through your intermediary server.","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\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery","og_locale":"en_US","og_type":"article","og_title":"Direct Image Uploads From the Browser to the Cloud With jQuery","og_description":"Learn how to directly uploads images with jQuery from your browser to the cloud without going through your intermediary server.","og_url":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery","og_site_name":"Cloudinary Blog","article_published_time":"2012-08-28T10:32:23+00:00","article_modified_time":"2024-06-01T00:44:21+00:00","og_image":[{"width":2000,"height":1100,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery"},"author":{"name":"","@id":""},"headline":"Direct Image Uploads From the Browser to the Cloud With jQuery","datePublished":"2012-08-28T10:32:23+00:00","dateModified":"2024-06-01T00:44:21+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery"},"wordCount":1569,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA","keywords":["Django","File-upload","jQuery","Ruby on Rails"],"inLanguage":"en-US","copyrightYear":"2012","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery","url":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery","name":"Upload Images with jQuery From the Browser to the Cloud","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA","datePublished":"2012-08-28T10:32:23+00:00","dateModified":"2024-06-01T00:44:21+00:00","description":"Learn how to directly uploads images with jQuery from your browser to the cloud without going through your intermediary server.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA","width":2000,"height":1100},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Direct Image Uploads From the Browser to the Cloud With jQuery"}]},{"@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\/v1647045698\/41_direct_uploads_jquery\/41_direct_uploads_jquery.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21150","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=21150"}],"version-history":[{"count":2,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21150\/revisions"}],"predecessor-version":[{"id":34196,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21150\/revisions\/34196"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/23366"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=21150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=21150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=21150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}