Re: [framework-one] File Upload

243 views
Skip to first unread message

Sean Corfield

unread,
Sep 10, 2012, 1:14:13 AM9/10/12
to framew...@googlegroups.com
On Sun, Sep 9, 2012 at 9:17 PM, DhieniL <afdhald...@gmail.com> wrote:
> Hi All, Can someone help me how to upload file in FW1? Thanks...

The exact same way you'd upload a file without FW/1.

Can you be a bit more specific about what you've tried - show us code
- and what exactly goes wrong with it?
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

Nathan Dintenfass

unread,
Sep 10, 2012, 12:25:05 PM9/10/12
to framew...@googlegroups.com
As Sean said it isn't any different than how you'd do it in other
situations. That said, if you're used to having your code not well
organized and are moving to a FW/1 organization it can be confusing.

One example I used recently is a form where people can upload files for
review. In my controller I call my general service that internally has
a "fileService" instance it can use.

I put my little fileService utility up here:

https://gist.github.com/3691868

You could also just call this directly from your controller.

HTH,

- Nathan D


On 9/9/12 9:17 PM, DhieniL wrote:
> Hi All, Can someone help me how to upload file in FW1? Thanks...
>
> --
> FW/1 on RIAForge: http://fw1.riaforge.org/
>
> FW/1 on github: http://github.com/seancorfield/fw1
>
> FW/1 on Google Groups: http://groups.google.com/group/framework-one

unclesol

unread,
Dec 16, 2014, 9:22:04 AM12/16/14
to framew...@googlegroups.com, seanco...@gmail.com
I am having a problem with this is well. This is what I have done...

1) In my form, I have an input with a type of "file" named "fileToUpload". The action of the form points to a controller named "fileManagement" and a method named "uploadFile".
2) The controller takes the file data (a few other things from the form) and populates a bean with it and then sends the bean to a method (uploadFile) in a service called "fileService" along with the rc reference to the file input field (rc.fileToUpload).
3) The fileService method, uploadFile, calls the ColdFusion function FileUpload with the fileData field pointing to the fileToUpload argument.
4) I get a CF error saying the string to the temp file does not contain a file ("The form field /Applications/ColdFusion11/cfusion/runtime/work/Catalina/localhost/tmp/neotmp3318191872459867163.tmp did not contain a file.")

Matt Quackenbush

unread,
Dec 16, 2014, 9:30:40 AM12/16/14
to framew...@googlegroups.com
On Tue, Dec 16, 2014 at 8:22 AM, unclesol <smith....@gmail.com> wrote:
2) The controller takes the file data (a few other things from the form) and populates a bean with it and then sends the bean to a method (uploadFile) in a service called "fileService" along with the rc reference to the file input field (rc.fileToUpload).
 

CFML does not work like that. You have to pass the name of the form field, not a reference (rc.fileToUpload).

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSd160b5fdf5100e8f36f73035129d9e70a92-8000.html

Reply all
Reply to author
Forward
0 new messages