Tag: base64

如何使用Epplus从Base64编码的图像在Excel中插入图片

我有一个格式为Base64的图像。 我需要显示从Base64编码图像的图片单元格。

转换excel base64到可下载的文件PHP

大家,即时通讯运行在一些问题,现在看到的内部情况与服务器,我不能控制或任何东西现在我不能使用base64编码的文件直接通过网站,因为当服务器提供内容的浏览器,它有一个字符的限制对于这些任务,它直接影响这些string长度的base64编码文件的原因,所以我做了一个系统的PHP脚本,将已经存在的base64 pdf文件作为可下载的文件提交给客户端,它的工作原理是这样的: $reg = File::find($args->string('id')); //querying the file from database $filename = $reg->filename; //the original file name $base64 = $reg->file; //the base64 encoded file $meta_type = explode(',', $base64) [0]; //getting the meta type of the file $meta_type = str_replace('data:', '', $meta_type); $meta_type = str_replace(';base64', '', $meta_type); $file = explode(',', $base64) [1]; $file = base64_decode($base64); //decoding […]

Base64编码的excel文件不能在电子邮件附件中解码

我正在创build一个excel文件并将其附加到电子邮件中。 电子邮件附带的excel文件发送,但内容全部被删除(N o s e> j×!êh®×è®Ø^¥ê‰Úz MMy¶9×Í'×)。 $sFileName = "BatchReport".date("Ymd"); $eContent = chunk_split(base64_encode(file_get_contents(WP_PLUGIN_DIR."/cs-cart/includes/excel/".$sFileName.".xls"))); $sUniqueID = md5(uniqid(time())); $sHeaders = "From: " . (($sFrom) ? $sFrom : "Cervid Solutions <admin@" . str_replace("www.","",$_SERVER["HTTP_HOST"]) . ">") . "\n" . "MIME-Version: 1.0\n" . "Content-Type: multipart/mixed; boundary=".$sUniqueID."\n\n" . "This is a multi-part message in MIME format.\r\n" . "–".$sUniqueID."\r\n" . "Content-Type: text/plain; […]

ASP.NET:将Base64数据导出到Excel

我在ASP.NET中实现了一些网页。 我想导出一个图像(base64数据),以Excel。 这是我的代码片断,它使破碎的Excel文件。 像下面一样 덽NG IHDR뛬&?IDAT?? ?꾉1?X?铠?IEND췇` 我怎么解决这个问题? protected void btn_export_Click(object sender, EventArgs e) { string fileName = string.Format("File_{0}.xls", DateTime.Now); // red dot string data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; string base64Data = Regex.Match(data, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value; byte[] binData = Convert.FromBase64String(base64Data); using (MemoryStream stream = new MemoryStream(binData)) { // it works well.. System.Drawing.Image image = new Bitmap(stream); image.Save(Server.MapPath("~/Images/file.png")); // Problem […]

在Excel中插入xlsx文件(Office插件)

如何在Excel工作表上插入和xlsx文件? 就像在Word中插入Document.body.insertFilefromBase64或Ooxml或Html一样。 Excel没有在工作表或工作簿中的插入方法。 文档

document.location不生成文件

我正在尝试生成Excel文件,并在用户单击button时在浏览器中下载。 var vFullExportContent = getExcelXmlNew(includeHidden, fullPageStore); 这用XML生成Excel文件数据。 我想使用Base64进行编码,并使用下面的代码行使用document.location下载文件。 而当我有我的Excellogging超过1000行时,这不会生成一个文件。 低于1000行是可以的。 document.location='data:application/vnd.ms-excel;base64,' + Base64.encode(vFullExportContent); 而且我也validation了我所有的(3259行)数据的任何编码问题,没有观察到任何东西。 那就是我在应用程序中应用filter来检索低于千分之一的独特行,并且所有三次报告下载。 非常感谢帮助。

Base64 excel文件streamAspose.Cells.CellsException

我有一个xls文件的Base64string。 当我尝试打开base64stream时,会引发以下exception Aspose.Cells.CellsException :这个文件的格式不被支持,或者你没有指定正确的格式。 public Stream ConvertFileToStream(string fileBase64) { var fileAsBytes = Convert.FromBase64String(fileBase64); Stream stream = new MemoryStream(fileAsBytes); return stream; } public void Open(Stream fileSource) { FileFormatUtil.DetectFileFormat(fileSource); _workbook = new Workbook(fileSource); }

如何使用PHP导出数据和base64图像来优化?

我试图出口以下擅长,但图像不通过。 例: $today = date("d/m/y : H:i:s", time()); header ("Content-Type: application/x-msexcel"); header ("Content-Disposition: attachment; filename=\"export.xls\"" ); echo ' <table> <tr> <th nowrap="nowrap">Client ID</th> <th nowrap="nowrap">Client Name</th> <th nowrap="nowrap">No. of Staff</th> <th nowrap="nowrap">No. of Events</th> <th nowrap="nowrap">Fail all\'s</th> <th nowrap="nowrap">Fail Section</th> <th nowrap="nowrap">Fail all %</th> </tr> <tr> <td nowrap="nowrap">8</td> <td nowrap="nowrap">SEAI</td> <td nowrap="nowrap"><div> 17 </div></td> <td […]

在excel函数中将hexstring转换为base64

我有一个很长的hex值的string,需要转换为base64。 我正在寻找一个简单的格式单元格函数,如= Hex2b64(Hexstring),它将接受任何长度的hex字符。 我已经find了碎片,但没有一个简单的代码块。 我一直在使用http://home.paulschou.net/tools/xlate/为了做手动到这一点。 转换工作正常,数据被所有相关的数据库接收,并进行适当的parsing。 我收到的数据是hex表示二进制,它已被转换成多个块,并按照我不知道的项目文档连接成长hexstring。 一个典型的inputstring将是:hex= 00014088F6650101393939393939392D30304646463238313030000343332353430342D35353FA10000002805900100002805 并且相应的输出将是:B64 = AAFAiPZlAQE5OTk5OTk5LTAwRkZGMjgxMDAAA0MzI1NDA0LTU1P6EAAAAoBZABAAAoAF

不正确的base64编码VBA

我试图在VBA Excel中将JPG图像编码为HTML (<img src="data:image/jpg .." />) Base64格式。 我发现了一个类似的问题, 在Excel VBA中将图像(jpg)转换为base64? ,并尝试了代码: 'https://stackoverflow.com/questions/2043393/convert-image-jpg-to-base64-in-excel-vba Sub EncodeFile() Dim strPicPath: strPicPath = "MyDriveHere:\SomePath\image.jpg" 'Credit to Wikipedia for orange picture: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Citrus_reticulata_April_2013_Nordbaden.JPG/220px-Citrus_reticulata_April_2013_Nordbaden.JPG Const adTypeBinary = 1 ' Binary file is encoded ' Variables for encoding Dim objXML Dim objDocElem ' Variable for reading binary picture Dim objStream ' Open data stream […]