WordPress - uploading images directly to cdn and store thier cdn url
Hi all,
as i am trying to keep my WordPress site light I'm trying to avoid installing plugins that are making my site run slower.
I wanted to ask if there is a code example or any documentation that explains how can i use the WordPress hook for media uploads and make it upload the images selected by a user directly to our cloudinary.
so instead of storing the image on our WordPress site media library it will be stored in the cloud and the CDN image url will be saved on our WordPress site as the URL for the image we have uploaded.
Thank you!
-
Hi Yossi,
I can see one option if you have decided you don't want to use the plugin, but this option would not be the most optimal way to deliver your images on your website.
You can manually insert the URL generated from Cloudinary into your Wordpress website to display images.The downside to this will be you will have to do a lot of manual editing.
0 -
Hi Akshay,
The reason i don't want to use your plugin is because it damage the performance of my site.
once i activate it it really slows everything.
My customer still want to stay with your CDN service but asked me to remove your plugin from his site and use your api in order to upload new images to the CDN.
Are you sure you don't have any API for what I'm asking?
what about other non-WordPress website client of yours - they can not use your WordPress plugin - dont they have an option to use an api call to upload new images to the CDN?
I'm talking about a basic api call that will allow me to upload new images to the cloud...
can you please recheck? if the manual upload option you have mentioned is the only option that mean my customer will cancel his subscription with you.... :(
My plan is to use WordPress hook and simply make an ajax call to your api when user want to upload a new image
0 -
Hi Yossi,
You can upload your images directly using the PHP SDK, or via a direct call to the upload API, and then update your WordPress database directly.
You can read more about the upload options here:
https://cloudinary.com/documentation/php_image_and_video_upload
With that said, using the WordPress plugin is recommended in this case, and should work well for you. If you would like to open a support ticket at: https://support.cloudinary.com/hc/en-us/requests/new, and share a link to your site and the WordPress plugin version you are using, we will gladly further look into it.
Best regards,
Michal
0 -
Hi Michal,
Must i install your PHP SDK for that or do you have a
or can i take the solution on the client side only?
in the link you have provided there is a mention to a jQuery plugin:
"Alternatively, you can use Cloudinary's jQuery plugin as described in the following sections."
see here:
https://github.com/cloudinary/cloudinary_js/tree/master/js
want to know if i can simply use clent side code such as vanila js or Jquery instead of installing a new PHP SDK on my server.
Thanks!
0 -
Hi Yossi,
You can use a client-side upload without installing an SDK.
You can refer to these docs for more info:
https://cloudinary.com/documentation/upload_images#uploading_with_a_direct_call_to_the_rest_api
https://cloudinary.com/documentation/upload_images#direct_uploading_from_the_browser
Let us know if you need any further assistance with this.
Regards,
Michal
0
Post is closed for comments.
Comments
5 comments