Problem in viewing attachment (image) of API BIM360 - autodesk-forge

Looking at some tutorials (I can't find the link I consulted), I was able to access an issue's attachment, but I'm not able to transform the data (Binary) into an image. follows an image of how my response is coming.
enter image description here

Are you perhaps referring to https://bim360-issue-editor.herokuapp.com? The source code of this sample is available at https://github.com/petrbroz/bim360-issue-editor.
Here's how the server side requests the attachment: https://github.com/petrbroz/bim360-issue-editor/blob/develop/routes/api/issues.js#L309-L331.
And here's how the client side turns it into an image:
https://github.com/petrbroz/bim360-issue-editor/blob/develop/public/issues.js#L405-L443

Related

Image dissapears when HTML is sent via Internet

I have some HTML file with an <img src="..."></> tag inside. I can open the HTML and see the image just fine. But when I sent this HTML file to someone (by email, Skype, or whatever), even to me, the image is no longer there. The error I get when I open the HTML that I sent to myself is:
Failed to load resource: net::ERR_FILE_NOT_FOUND
What may be causing the problem? I thought of uploading the image somewhere on the Internet, so there will be no problem with finding it when I point to it with a url.
if the source of the image is on your computer and not using a url, then you will either need to upload the image source onto the web or email the image source to the recipient.
you also need to make sure to have the image source located in the correct location/directory

How to fix 403 error while displaying images from google drive?

I am displaying around 20 thumbnail images at a time from google drive using the following link syntax, the thumbnail links are stored in a database and are grabbed using ajax POST request. I am testing this on localhost and every time i clear the cache and reload i get a 403 no response from server error on at least a few images. The images are public and are made accessable to anyone and visiting the link manually opens the image every time.
Heres the link i use:
"https://lh3.googleusercontent.com/d/" + imgid + "=s500?authuser=0"
Why are you using this link to get the files?
Try to get one of the links in the File resource:
webContentLink Link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.
webViewLink Link for opening the file in a relevant Google editor or viewer in a browser.
iconLink Static, unauthenticated link to the file's icon.
thumbnailLink A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
Choose one of the attributes that best fit your needs after that. Make the necessary request
GET https://www.googleapis.com/drive/v3/files/<yout-file-id>?fields=webContentLink&key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
After that you can use your retrieved link to show the image.
There is on person having your problem if you want to look over the final result of the img tag.

Generated Hosted Images by URL (Specifically QR Codes)

Okay that title might sound confusing but it's hard to describe in a title.
Basically, when you display an image online you typically reference it by URL as the image must be hosted somewhere. So for example this image url is:
https://www.gettyimages.ie/gi-resources/images/Homepage/Hero/UK/CMS_Creative_164657191_Kingfisher.jpg
So what I assume is happening is the link tells the webpage where to find the data and then the hosting server replies with the image.
My question is
If a web page can interpret a link with information such as
www.example.com/__?id=01&user=ExampleName&email=exampleEmail
and use that information (id, user, and email) to then generate an image could it return the data without actually hosting the image? As in it's just receiving a request and replying?
The goal of this is to have a page with an image that is a QR code generated by an external webapp.
Yes.
Implementation details would of course differ depending on the chosen server side language, but in the end you're going to send a response which would contain the generated image data (in your case the QR code) and the appropriate headers in order for the browser (or requester of the resource) to properly interpret the response.
Example of what you're asking for would be placeholder.com where it responds with an image depending on certain parameters you provide in the URL.
You can also check for example the requests being sent on https://www.qr-code-generator.com (and probably also other QR generator sites) and see that the codes there are generated similarly to your idea.

Embedding a static image in html email

I have a requirement where in I have to to send an email to customer, I have an email template coming in from database (blob data). And there is an header image which should be displayed in the email when customer opens the email.
The image will not be available on server
The image will not be available online (i.e in any website online).
This image is a client header. How can I embed the static image without referring to any location or any online website.
Yes this is possible by encoding the image in Base64
For more info see this Displaying images in webpage without src URL
Finally you will end up with something like this in your html message:
<img src="data:image/png;base64,iVBORw0KGgoAA.........very_long_string....." />
The general solution to this problem is multipart MIME. You add the image as a part of the email message and use a cid reference in the <img> tag.
However, you're probably using some library to send this email, in which case it probably has an API for creating multipart MIME messages.
in case you don't want to load images from the server then only embeding of image with base64 can workout.
Please refer the link below for more reference.
http://www.bigfastblog.com/embed-base64-encoded-images-inline-in-html

facebook wall post images

I'm able to post a status on the users wall using GRAPH API - https://graph.facebook.com/me/feed/. But I have problem with the image associated with the post.
In my case, the picture URL looks like this : https://images.XXXXXX.com/Images.aspx?imageId=??? , retrieves image based on request parameter . If I mention the URL as above I don't see the images displayed . Whereas if I mention the picture URL as a static URL (i.e. https://digitalpictures/test.gif), it works . Please help me to resolve this problem
You could save the image from the picture URL as a file with a static URL, then delete it once it's been uploaded to Facebook.
Make sure the https://images.XXXXXX.com/Images.aspx?imageId=??? can be seen by the facebook linter tool. Use it as an og:image tag on a public url. If facebook can't lint it, you can use it as the Picture URL in your graph API call.
Add Open Graph tags to the GRAPH API request, specifically "og:image", "https://images.XXXXXX.com/Images.aspx?imageId=??" for your image.
Facebook Open Graph Protocol 1