天道酬勤,学无止境

cffile

CFFILE - Uploading a file using a component

I have a form that I would like to submit to a component for processing (CRUD behaviors), the problem is it seems passing multipart/form-data to a component somehow looses the file location. When it gets to the part of the component that should be uploading the file I get the infamous form field did not contain a file error. I am not 100% sure why this happening but if I submit the form directly to a .cfm page that performs the cffile action everything works as expected, but if the .cfm page does something like: <cfobject name="process_form" component="processor" /> <cfset result = process

2022-01-10 05:32:58    分类:问答    coldfusion   cffile

Using Coldfusion's CFFILE tag to monitor a progress log from FFMpeg

I want to learn how to use the CFFILE tag from ColdFusion to read the contents of a text file. In my case, that text file is a progress log that is generated by FFMpeg while it transcodes a media file. I want to write a ColdFusion script that will poll the progress log periodically, until the log indicates that FFMpeg has finished its transcoding operation. On the client side I can then use Ajax to hit that ColdFusion script and show the user a "percentage completed" while FFMpeg does its work. I got FFMpeg to generate the log file by using a new "progress" flag that recent versions of FFMpeg

2021-08-12 15:13:13    分类:问答    ajax   coldfusion   ffmpeg   cffile

Coldfusion 如何在数据库中保存pdf文件并在浏览器中获取它(coldfusion How to save pdf file in database and fetch it in browser)

问题 插入到 MS-SQL 2008 数据库 <cffile action="READBINARY" file="#form.FileContents#" variable="binPDF"> <cfquery name="Uploaded" datasource="#cfbasedatasource#"> INSERT INTO UploadedFiles ( AccountId, Filecontent ) VALUES ( '#UrlAccountId#', <cfqueryparam value='#binPDF#' cfsqltype='cf_sql_blob'> ) </cfquery> ======================== 这是从数据库到浏览器的显示: <cfset binaryData = #cfGetfilecontentquery.Filecontent[1]#> <cfheader name="Content-Disposition" value="inline; filename=testDocument.pdf"> <cfcontent variable="#binarydata#" type="application/pdf" reset="yes" /> 但我只能在浏览器中看到“加载 PDF 文档失败” 回答1 您的代码原则上是正确的。

2021-06-22 22:56:17    分类:技术分享    database   pdf   coldfusion   cffile

使用 jquery 和 Coldfusion cffile 上传多个文件(Upload multiple files with jquery and coldfusion cffile)

问题 不是一个真正的问题......只是想把它张贴在某个地方,因为我在别处找不到它。 现在我已经拼凑了一个工作演示,我想我会分享。 这在 Coldfusion 和 Railo CFML 服务器上同样有​​效。 问题是对于 CFML 开发人员来说,CFFILE 不适用于<input type="file" multiple> ...传统上,如果您想上传 3 个文件并在后端使用 CFFILE,则必须包含 3 个单独的文件呼叫页面上的输入。 为了简单起见,这是我的解决方案。 它使用 Jquery $.ajax 对 CFFILE 进行多次调用,并将结果返回到调用页面上的 div。 我确信有更好的方法来做到这一点,我的代码可能是一个完整的黑客,但下面的例子有效。 希望这可以帮助某人。 multiFileUpload.cfm <!DOCTYPE html> <CFPARAM Name="URL.contractID" defualt=""> <head> <title>Multi File Upload</title> <script> $( document ).ready(function() { $('#submitFrm').on("click", function(e){ e.preventDefault(); //The jquery.each() statement loops

2021-06-10 20:40:19    分类:技术分享    jquery   ajax   coldfusion   cffile

Upload multiple files with jquery and coldfusion cffile

Not really a question... Just wanted to post this somewhere because I couldnt find it elsewhere. Now that I've cobbled together a working demo I thought i would share. This works equally well on Coldfusion and Railo CFML servers. The problem is that for CFML developers is that CFFILE doesn't work with <input type="file" multiple> ... traditionally if you wanted to upload 3 files and use CFFILE on the back end you would have to include 3 separate file inputs on your calling page. Here is my solution shaved down for simplicity. It uses Jquery $.ajax to make several calls to CFFILE and returns

2021-05-25 01:38:58    分类:问答    jquery   ajax   coldfusion   cffile

coldfusion How to save pdf file in database and fetch it in browser

Insert to MS-SQL 2008 Database <cffile action="READBINARY" file="#form.FileContents#" variable="binPDF"> <cfquery name="Uploaded" datasource="#cfbasedatasource#"> INSERT INTO UploadedFiles ( AccountId, Filecontent ) VALUES ( '#UrlAccountId#', <cfqueryparam value='#binPDF#' cfsqltype='cf_sql_blob'> ) </cfquery> ========================= This is Show from Database to browser: <cfset binaryData = #cfGetfilecontentquery.Filecontent[1]#> <cfheader name="Content-Disposition" value="inline; filename=testDocument.pdf"> <cfcontent variable="#binarydata#" type="application/pdf" reset="yes" /> But I can

2021-05-09 03:18:01    分类:问答    database   pdf   coldfusion   cffile