There are two possible solutions :
The first is:
There is a widget called fileUpload.  Import the tags/widget folder, then in
place of the form field in your edit form call this tag.

<cfimport taglib="/farcry/farcry_core/tags/widgets" prefix="widgets" />
<widgets:fileUpload fieldLabel="Upload a new file :"
filefieldPrefix="myfile" fieldValue="#stObj.FileNameField#">

When your form is submitted the file will be in the form field
#filefieldPrefix#_file_upload. If you're editing a record and don't change
the uploaded file then #fileFieldPrefix#_file_original will contain the
original file name.

In your edit function you will need to handle uploading/saving the file to
the appropriate location.  This would store the filename in your custom type
record.

The other is:
You could also use the ObjectPicker widget, which would allow your users to
select files that have previously been uploaded into the File Library.

<cfimport taglib="/farcry/farcry_core/tags/widgets" prefix="widgets" />
<widgets:objectPicker typename="dmFile" fieldName="FileUploadField"
fieldLabel="Upload a new file :" fieldValue="#stObj.FileNameField#">

This would store a UUID in your custom type record.

If you decide to use this method, make sure you get the update to
objectPicker from subversion that Jeff submitted for me yesterday.
http://fisheye3.cenqua.com/changelog/farcrycms/

Hope that helps

Stephen

On 19/12/06, BridgetGrey <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Finally got it all figured out and sorted. One thing left to do is some
> file
> management.
>
> I need to allow users to "browse" for a file local on their PC and attach
> it
> to a content object in one of those custom types I created. So .. does
> anyone know how to create a new file object (based on a form input
> type="file"), return an object-id to store in my table and upload the file
> somewhere on the server. I've seen that there is a capacity to upload a
> file
> in other sections of the application however i've spent over 2 hours
> trying
> glancing over the code and found it to be a little complex. Your help
> would
> really be appreciated.
>
> Cheers,
> Brid x
>
>
>
> Blair McKenzie-2 wrote:
> >
> > Here is an expamle of one of my types:
> >
> > <cfset editobjectURL =
> >
> "#application.url.farcry#/conjuror/invocation.cfm?objectid=##recordset.objectID[
> > recordset.currentrow]##&typename=bmStepRecord">
> >
> > <widgets:typeadmin
> >     typename="bmStepRecord"
> >     permissionset="news"
> >     title="Manage Step Record"
> >     numPageDisplay="25"
> >     bFilterCategories=false
> >     orderby="steps"
> >     bdebug="0">
> >
> >     <widgets:typeadmincolumn columntype="expression"
> > title="#application.adminBundle[session.dmProfile.locale].select#"
> > value="<input type=""checkbox"" class=""f-checkbox"" name=""objectid""
> > value=""##recordset.objectid##"" onclick=""setRowBackground(this);"" />"
> > style="text-align: center" />
> >     <widgets:typeadmincolumn columntype="evaluate"
> > title="#application.adminBundle[session.dmProfile.locale].edit#"
> > value="iif(
> > stPermissions.iEdit eq 1,DE(iif(locked and lockedby neq
> >
> '##session.dmSec.authentication.userlogin##_##session.dmSec.authentication.userDirectory##',DE('<span
> > style=""color:red"">Locked</span>'),DE('     '))),DE('-'))"
> > style="text-align: center" />
> >     <widgets:typeadmincolumn columntype="evaluate" title="Person"
> > value="iif(stPermissions.iEdit eq 1,DE(iif(locked and lockedby neq
> >
> '#session.dmSec.authentication.userlogin#_#session.dmSec.authentication.userDirectory#',DE('##replace(
> > recordset.accountname[recordset.currentrow],'####','','all')##'),DE('
> > ##replace(recordset.accountname[
> > recordset.currentrow],'####','','all')## '))),DE('##replace(
> > recordset.accountname[recordset.currentrow],'####','','all')##'))"
> > style="text-align: left" orderby="accountname" />
> >     <widgets:typeadmincolumn columntype="evaluate" title="Record date"
> > value="application.thisCalendar.i18nDateFormat('##recorddate##',
> > session.dmProfile.locale,application.mediumF)" style="text-align:
> center"
> > orderby="recordDate" />
> >     <widgets:typeadmincolumn columntype="evaluate" title="Steps"
> > value="##recordset.steps[currentrow]##" style="text-align: center"
> > orderby="steps" />
> >     <widgets:typeadmincolumn columntype="evaluate" title="Creation date"
> > value="application.thisCalendar.i18nDateFormat('##datetimecreated##',
> > session.dmProfile.locale,application.mediumF)" style="text-align:
> center"
> > orderby="publishDate" />
> > </widgets:typeadmin>
> >
> > Blair
> >
> > On 12/17/06, BridgetGrey <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>
> >>
> >> Thanks Blair, figured it out from the link.
> >>
> >> Only problem i'm having now is displaying the data from the tables that
> >> hold
> >> my custom content from within the TypeAdmin buttons.
> >>
> >> Cheers!
> >> Bridge x
> >>
> >>
> >> Blair McKenzie-2 wrote:
> >> >
> >> > The basics of changing the typeadmin buttons/columns are
> >> > here<
> >>
> http://bugs.farcrycms.org:8080/confluence/display/FCDEV30/Custom+Types#CustomTypes-ChangingtheColumns
> >> >.
> >> > It is important to note that if you manually add columns, the default
> >> > columns won't be added at all. You will need to manually reimplement
> >> them.
> >> >
> >> > Blair
> >> >
> >> > On 12/14/06, BridgetGrey <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >>
> >> >>
> >> >> Hi. Being fairly knew to Farcry (but have been coding in CF for 4+
> >> years)
> >> >> i'm
> >> >> struggling a little to get my head around some of the custom admin
> >> pages.
> >> >> In
> >> >> particular editing the custom types i've created. Any help you could
> >> >> offer
> >> >> here would be great !
> >> >>
> >> >> I have written a few custom types that I require to allow my users
> to
> >> >> add/edit/delete content etc.
> >> >>
> >> >> The bit i'm stuck on is customizing the search interface from within
> >> the
> >> >> FC
> >> >> administrator. I've search over the forums and couldn't quite find
> >> what
> >> I
> >> >> was after.
> >> >>
> >> >> Below is my list.cfm located in the [app_name]/customadmin/outcomes
> >> >> directory which displays a list of outcomes which my users will be
> >> >> editing/creating. I've written custom PLP's which allow the user to
> >> edit
> >> >> these content items and that is working fine!
> >> >>
> >> >> <cfsetting enablecfoutputonly="yes">
> >> >>         <cfimport taglib="/farcry/farcry_core/tags/admin/"
> >> >> prefix="admin">
> >> >>         <cfimport taglib="/farcry/farcry_core/tags/widgets/"
> >> >> prefix="widgets">
> >> >>
> >> >>         <!--- set up page header --->
> >> >>         <admin:header>
> >> >>
> >> >>         <widgets:typeadmin
> >> >>                         typename="outcomes"
> >> >>                         title="Outcomes Administrator"
> >> >>                         description="Outcomes Object"
> >> >>
> >> >>
> >> >> handlerRoot="/#application.applicationname#/handlers"
> >> >>                         metadata = "True"
> >> >>                         permissionset="news"
> >> >>                         >
> >> >>          </widgets:typeadmin>
> >> >>
> >> >>         <!--- setup footer --->
> >> >>         <admin:footer>
> >> >> <cfsetting enablecfoutputonly="no">
> >> >>
> >> >> Now, there are a few fields which I don't use (and don't want to be
> >> >> displayed to my users) such as label for example, however there are
> >> >> others
> >> >> which i've created in my outcomes.cfc which I would like to be
> >> displayed
> >> >> on
> >> >> that page (OutcomeName, OutcomeDescription etc). Would someone be
> able
> >> to
> >> >> steer me in the right direction on how to remove some of the
> "default"
> >> >> content labels and add in my own.
> >> >>
> >> >> Cheers!
> >> >> Bridge :)
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/Custom-Content-edit-labels-in-FC-Admin-tf2820604s621.html#a7872488
> >> >> Sent from the FarCry - Dev mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> >
> >> >>
> >> >
> >> >
> >> > >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Custom-Content-edit-labels-in-FC-Admin-tf2820604s621.html#a7915375
> >> Sent from the FarCry - Dev mailing list archive at Nabble.com.
> >>
> >>
> >> >
> >>
> >
> >
> > >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Custom-Content-edit-labels-in-FC-Admin-tf2820604s621.html#a7944739
> Sent from the FarCry - Dev mailing list archive at Nabble.com.
>
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to