[cfaussie] zero length file in cffile
I think I have users trying to upload a file that they still have open (in Word or Acrobat etc) Is there some simple try catch I could use to trap this? Thanks _ POP access for Hotmail is here! Click here to find out more http://windowslive.ninemsn.com.au/article.aspx?id=802246 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: zero length file in cffile
Hi Mark, I had some issues reply via email - and find I can;t attach files here either... so here it is inline... --=-=-=-=-=-=--=-= Not sure if this is going to be much good to you or not, But I have attached the file-add form and submit that we use here. You might be able to hack it up for your own purposes. (note we submit the file into the database as opposed to using the file system, but the checking all works and should help with your 0 file check.) -=--=-=- !--- $Date: 2009-03-02 02:58:14 +1100 (Mon, 02 Mar 2009) $ $Author: awaddell $ $Revision: 6578 $ $HeadURL: http://192.168.10.95/svn/palcare/trunk/nz/mp/patient/scandocadd.cfm $ Copyright (c) 2008. PalCare Pty. Ltd. --- !--- check for a valid session --- cfif not isdefined(session.username) !--- there is no valid session. relocate to a custom error page --- cflocation url=noSession.cfm cfelse script language=javascript type=text/javascript function close_me() { window.opener.location.href = window.opener.location.href; window.opener.location.reload(true); window.close(); } /script cf_simple cfinclude template=qry_scandocTypeSELECT.cfm !--- Attachments information / variable declaration /array construction --- !--- check if the array exists already --- cfif NOT isdefined('session.filearray')!--- if not, create it (2 dimensions) --- cfset session.filearray = arrayNew(2) /cfif cfparam name=session.var_numfilesadded default=0 !--- set the Max file size to 10 MB --- cfset var_filesizebytes = 10485760 cfset file_name= cfset file_type= cfset file_description= cfset the_file= cfset file_size= cfset documentTypeid= cfset file_inserted_by= cfset file_insert_date= link rel=stylesheet href=style.css / script language=javascript type=text/javascript //javascript function captures the filename for use on the next page add_file_action.cfm //This is required as the filename gets made into templocation/ tempfilename.tmp and is thus unusable // for insertion into the DB as the filename and filetype. function setfilename(formvalue) { document.forms['addfile']['thefile'].value = formvalue; } /script cfoutput cfform action=scandocaddsubmit.cfm method=post name=addfile enctype=multipart/form-data !--- set the button text based on if there is a file or not --- cfif ArrayLen(session.filearray) GT 0 cfset buttontext1 = Finish!--- set to finish if a file exists in the array --- cfelse cfset buttontext1 = Cancel!--- set to Cancel if the array is empty--- /cfif table width=100% tr align=center !--- Centre align the INNER Table --- td table width=90% border=0 cellpadding=0 cellspacing=0 tr th align=center colspan=3Supplementary Information - Attached Files/th /tr tr td colspan=3nbsp;/td !---space row --- /tr tr align=left valign=top !--- see javascript comments for why / how this ONCHANGE function works --- td colspan=3strongPlease Choose a File to attach to this patient's Record (Limit of 10MB per file)/strongbr / input type=File name=formfilename
[cfaussie] Re: CF8 file not found strangeness
Hi all, Finally got this issue worked out. It turns out that they didn't have modify permissions for my user on c:\coldfusion8\wwwroot\web-inf\cfclasses\ Not a word of apology for wasting my time telling me it was my problem. I don't understand how a company claiming to offer a standard shared hosting package would have such a basic issue come up. Thanks for everyones help here, it really set my mind at ease that I hadn't forgotten how to write a 3 line CF page. bye! On Mon, Jun 22, 2009 at 7:43 PM, Ryanrya...@gmail.com wrote: Hi all, I've had a shared CF8 site set up at WebCentral for a relatively simple site. It's exhibiting a really strange error. If I FTP upload a file, say testfile.cfm (doesn't matter what is in it) it will work fine. If I then re-upload exactly the same file, it's returning a File not --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---