简体   繁体   中英

Save src data:image information as file

I am using classic asp and I have created a preview script in jQuery.

$('#file').change(function(){ 
    var oFReader = new FileReader(); 
    oFReader.readAsDataURL(this.files[0]);
    oFReader.onLoad = function (oFREvent) {
       $('#preview').html('<img id="trial" src="' + oFReader.target.result + '">');
       };
});

This works add provides a preview of the image inside of the div called #preview.

What I now need to do is physically save the file into a directory on the website?

The resultant img tag has the following src value:

 src = 'data:image/PNG; base64,XXXXXXXXX'

Where XXXXXXXXX is a base 64 encode string and PNG is just the file type (can also be JPG, GIF, etc)

似乎没有一种轻松实现此目的的方法,因此我创建了一个.Net DLL为我完成这项工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM