-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nhipster blob entity generator issue front angular #201
Comments
@Toysurusse Can you please create a PR to fix this? I'll add a bug bounty for extra motivation. :) |
Ok perfect, I can prepare it for you. I've never worked on generator part of nhipster ; but I will make a PR and assign it to you when it should be done :) |
Hi @Toysurusse, thanks for the interest!! But if the issue is related to NHipster server generator, could you open this in the related repo? @mraible could you remove the bug bounty tag here and add it in the new issue created in case of mirror issue? Thanks a lot. |
@amanganiello90 I removed. Please let me know if there's a new issue to add it to. |
@Toysurusse your suggested PR is related only how the nodejs backend retrieve the blob? So the normal jhipster app does not have this issue? In this case you have to open an issue in the nhipster repository and fix the related template (if it is an angular template you have to overwrite the default jhipster adding the custom file in the https://github.com/jhipster/generator-jhipster-nodejs/tree/master/generators/client/templates/angular folder) |
@Toysurusse any news? Could I help you? Is it a issue only for NHipster? if it is that, could you open a ticket in the related repo in order to support the process and the development? Thanks. |
This issue is stale because it has been open 30 days with no activity. |
@Toysurusse ?? |
@amanganiello90 I have moved this ticket to the proper repository ;) |
Thanks. |
I have same error, because nest with typeor get the blob file from database on BUFFER type. and this sugested fix only work on determinates files. im using files. @column({ type: 'blob', name: 'documento', nullable: true }) @column({ name: 'documento_content_type', nullable: true }) on mi service: const blob = gestion.documento.toString('hex'); |
@jlopezjuy thanks for the response, but I don't understand very well your message. You are saying, that the fix suggested do not resolve the angular blob issue? |
yes, if i use blop to sabe pdf or other file type, the solution not work. |
But @Toysurusse suggests that fix resolved the blob issue. So I don't understand :( |
maybe the solution work only with images... not with files... |
Ahh ok, you say that if the blob is an image the fix works, instead if the blob is a generic file (for example a .txt) it does not work. Right? |
yes |
i was tested with diferent pdf and other files. |
@jlopezjuy thanks. Have you some suggestions to fix in order to work with every blob type? |
On java jhipster app this work ok because spring return blob into base64, typorm return Buffer... maybe thats is the problem...
mmm not yet, I keep trying to solve the bug, because I need a project that works with pdf |
Hi folks... i have worked on proyect last mont and one coworker solve this problem with this code:
getDocumentoById call this endpoint on nestjs
and entity use this attributes.
For now just calling getDocumentoById method open pdf or download other file types. I'll try this option today or tomorrow... |
Overview of the issue
How to fix Blob front Angular view issue ?
Motivation for or Use Case
When you use nhipster entity generator with an angular front. Angular can't render the image of the blob after beeing storage in database.
Reproduce the error
use nhipster entity generator and you will have issue to view blob from backend.
Suggest a Fix
when the service nest get the blob image from the server, the image is convert in an buffer of hexadecimal. So I had to fix the service to add a converter hexaToString like the following function :
const blob = roadMap.image.toString('hex');
var result = '';
for (var i = 0; i < blob.length; i = i + 2) {
var decval = parseInt(blob.substr(i, 2), 16);
result = result + String.fromCharCode(decval);
}
JHipster Version(s)
last version
JHipster configuration
nhipster
The text was updated successfully, but these errors were encountered: