Rails Ajax image upload not shown with cloudinary - javascript

i am using Cloudinary gem + carrierwave + JqueryFileUpload to configure an ajax display image once it is uploaded.it is working if i save the image to local folder (asset/images) but not with cloudinary.
with Ajax, the image is shown immediately with the image src loaded (through partial render), but with cloudinary, the src is not fetched with Ajax resulting in blank image uploaded. i will need to reload the page in order to see the uploaded image.
please advise or request specific codes to post for you all to assist on this.
thanks.

Related

How to load image if the image is available on AWS?

I upload image from vue, to server. The server will return the image url, but it's will process the image first, and then upload it to AWS. And the process may takes about 1 - 3 second untill the image fully uploaded to AWS
The problem is my vue already get the image url before the image fully upload, and try to load it in <img>, and an error happen, 404 not found. Because it's not fully uploaded to AWS.
Question:
How to automatically load an image as soon as the image available on AWS using best practice / clean way?
For now, I use looping, and use #error, and check every 1 second. But I think it's not clean

How to find image uploaded status from url or file name?

I have used cloudinary. I have uploaded an image to cloudinary and I want to get that image status from cloudinary that it is uploaded or not using cloudinary URL or from image name.
I am using jQuery and I want to display a list of images with their status uploaded on cloudinary. I have URL stored in my database.
Can anyone have an idea on this?
You can utilize the upload response (JSON) for this matter, as described here.

how to input a binary image file while uploading profile image file to IBM Connections using REST API

I am using REST client to upload a profile photo to IBM connections but i am struck at the part where you have to send binary image file along with the PUT request. So far I've done this:-
request.put("https://servername.com"/profiles/photo.do?
key="profileuserID"),
ContentType:image/jpeg
i have tried to put insert image by encoding it into base64 format or adding into file field in REST client. But it always returns nothing. It does remove the previous profile picture but it doesnt upload the new one.
Now i want to ask how to include binary image file in the request payload?

Img upload on opencart

I`m trying to add pictures to reviews on opencart products.
I use jquery.form.js (from here)
I get the name of the file(C:fakepath/Image.png),but I cant proceed from there.I cant figure our there exactly is this file located on the server.
Any help will be appreciated!
C:fakepath/Image.png is the path generated by browsing on windows when you are uploading the image with a input type file. You need to post the image on the server to get your image server path.

How to pass an uploaded image back to html

The setup I work on is the following: A HTML-page with a canvas element displaying a Processing JS sketch and a form that allows to pass parameters to the sketch using JS-function Processing.getInstanceById(getProcessingSketchId()).setSomeParam();, which works just fine.
The user should also be able to upload an image to the server, the name/path of which is then also handed to the sketch to do loadImage(String path). The file upload (using PHP from here) works perfectly fine as well but now here is the question:
How can I get the name of the uploaded image on the server and pass it to the Processing sketch?
If the form's action tag points to a distinct PHP-file, the site with the canvas sketch is quit (variable $destination not available) or if the form's action tag points to the site itself (being a PHP-site, checking for if(isset($_POST['formSubmitted'])) {), the sketch is restarted losing all the previously changed parameters.
I also managed to have the form submission target to an internal iframe and display the uploaded image there, but that still doesn't solve my problem.
Thanks a lot in advance for any helpful hints!
It sounds like you have the data flow worked out but are struggling because a standard form upload causes a page refresh.
I would suggest using AJAX to post the image to a specific PHP image receiver service. When the AJAX upload is complete, the javascript can then call to the server to fetch the uploaded object and manipulate it as needed without refreshing the page.

Categories

Resources