I a newbie working on my first FB3 project. I'm sure I'll have a lot of questions as I go along and here's my first:
I have a form that includes a file upload. I only want to allow gif, jpeg and pdf uploads. At first I tried parsing the file extension from the field value (uploadFile) before I actually processed the upload, but that often (not always???) came through as a *.tmp file. So then I thought I'd use Cftry/Cfcatch around the Cffile statement in my act_fileUpload template, using the accept attribute to limit mime types. That sort of worked, but the message I put in cfcatch did not display within the parent's layout. What I really wanted was to send 'em back to the form with a message that only the above file types are permitted like I do for other data validation errors. I tried <cfinclude template="#self#?fuseaction=ListingFileMgmt.FileUploadError"> and different hard-coded variations thinking I'd create a separate fuseaction for handling the error, but I kept getting errors finding the template. (I haven't worked with Cfcatch that much--can you use cfinclude?) I then tried <cflocation url="#self#?fuseaction=ListingFileMgmt.FileUploadError> and at least that got me back to FBX_Switch, but I lost all the attributes variables with the reload. I finally got it to work by passing all the necessary variables as URLs in cflocation--luckily it was a short form. Although I got it to work my questions are: 1.) What's the best way to handle a situation like this in FB3? 2.) Why does the upload file field value sometimes sometimes post as *.tmp? i.e.: C:\WINDOWS\TEMP\ACFB100.TMP when the actual file is blah.jpg? 3.) Why doesn't the message I include in CFcatch display within the parent layout? 4.) When using cfcatch, can you use cfinclude? 5.) If you cfcatch an error, should you pass it to a fuseaction in FBX_Switch? If so, how? I realize this depends on what you're catching, but I'm trying to keep all my program flow within the Switch file. Thanks for any input. Terry ==^================================================================ This email was sent to: [email protected] EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9 Or send an email to: [EMAIL PROTECTED] T O P I C A -- Register now to manage your mail! http://www.topica.com/partner/tag02/register ==^================================================================
