NodeJS module base-64

Редакция автор: stain

Модуль base-64 упаковывает и распаковывает формат base64.
А модули base64-coder-node, base64-js не смогли корректно преобразовать картинку. Но подозреваю тут дело скорее в том как именно она была закодирована.

Пример:

var base64 = require('base-64'); 
var urlvar3='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExMVFRUXFxcXFxYVFxYVFRcVFRUXFhcVFRcYHSggGBolHxgVITEhJSkrLi4uGB8zODMsNygtLisBCgoKDg0OGhAQGy0lICUtLS4tLS0tLS01LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAKEBOQMBIgACEQEDEQH/xAAcAAACAgMBAQAAAAAAAAAAAAADBAIFAAEGBwj/xABBEAABAwIEAgcFBgUDAwUAAAABAAIRAyEEEjFBUWEFBhMicYGRMkKhscEHFFJy0fAjYoKy8TOS4aLC0hUkU1Sz/8QAGgEAAwEBAQEAAAAAAAAAAAAAAAECAwQFBv/EACkRAAICAQQCAQQBBQAAAAAAAAABAhEDEiExQQRREwUiMmFxFDOBofD/2gAMAwEAAhEDEQA/AKCEKpRTVRqE9cB17AWtUpWFalULYPScmAgU2JhilhQGqxYykmHITnIAhUpBVeLEKxdVVfjaZKaRLQhmlM0m2WqNDimgyypiQvUqwk6lVMV2peo0IRLQakptrXhCpGyiWXlOhFo2pZDc5Ca+AiUiEigtMkJmnUS5cEE1VLQ0y4ZBQarEDD1kao6UqKsg5kofYLeaERlRNAAdRCkGwivIWgJTCgDqa2GBHLECoIToDHNSdQ3TOdK1QgRKlVUqhlAaxFDUmSBcpMK25ixoTAYa1RqBSBUHOQMUqhQDYTDmrTmp2JilWqh5yjPpLOyVCOjfVS9WohGYSVV6hIpsczSspG6Dh6iaCYDLXIrHJVSa5QWMueoOWmlTRQWLELZbZEcxYWIGKVQAhh1kWswoDmqiBLFVUlVqlNYhqWNNUkSwuFemiUXonoh1VzWggFxAjUidyNh4r2nozqLhaNNoD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SF8XRMkG7hfui8aiByn4In3Wj/wDZd6OTeJJJaB7QAg7wDMT5rXZu4t9B+qd0FL0J4TR3h9UWh7K0sUma4NcPBadq3z+a2sVIlhGa+nzW/df4j5FYsTXJfRJ/tU/yD5II28fqtLEClyNYfX98FlP9f+1YsUFIHW9s/mH1TOK9s+LfmtrEn/3+xvsGdR+X9UHBexiP6P8A9Fixax4ZcewT9vAfNEwftu8P1WLFnExJ4T2h+/eTY1P74LFi0ZURPE/X6rKn1H9qxYs+w9mYv3vyM+aIz2T4H+1aWJy5GLN9l3gz+0I3ut/ey2sQhQ4J+56fVRK0sTfBpPgxu3gVqlv4D5rFil8EM37x8SmqWo8Hf2rFiqJS5K6voPE/Rafq7wKxYp7J6IYffw+idxWrfBYsVQBEOsP+u/y/tCrqXsjxKxYrl2TL8n/I5hPa9fkgVNSsWLNj6GqXtt/KfkUssWJh0f/Z';
cutbysym = urlvar3.split(',')[1]; //обрезаем спереди до запятой включительно
buffile = base64.decode(cutbysym); //декодируем
var fs = require( 'fs' ); //подключаем библиотеку файловую систему
fs.writeFile ('d:\\test.jpg', buffile, 'binary', function(err){
                                    if (err) throw err
                                    console.log('File saved.');
});

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

Этот сайт использует Akismet для борьбы со спамом. Узнайте как обрабатываются ваши данные комментариев.