Is that a "one-image-at-a-time" processor, or will it handle
multiple images submitted at once?
Multiple images is what I'm trying to accomplish. I usually let
a user select all the images they want to upload before submitting
by letting them clone the file input.
Then, within the cfc method, I loop over the images and process each one.
I'm looking for some way to send a message back after each image is
processed.
Could I use writeOutput(SerializeJSON(result)); multiple times with a
method?
And is the code that starts with "if(ckMimeTypeObj.status == 0) {"
javascript
or cfscript? I guess it's got to be cfscript with "createObject..." in it?
Rick
-----Original Message-----
From: Dave l [mailto:[email protected]]
Sent: Monday, September 14, 2009 4:37 PM
To: cf-talk
Subject: Re: Is this possible with component methods in cf8?
oh no!
swfupload is ok but has some issues and limitations and it's not jquery
which makes interacting with it a bit more difficult.
I'm making a fairly sweet uploader in jquery and ended up using uploadify as
the base uploader but I alter the source code.
As far as the original question as to reporting back.. sure you can do it
but use writeoutput to send data back to js script but you need the js
script to update on change or look for change in intervals.
The one i'm making does:
1. uploads
2. checks mime
3. checks size
4. runs a virus check
5. renames to a uuid
6. if image converts to png to remove excess exif data without losing
quality
7. stops and returns to script to add description
8. then does an ajax submit with info on resizing and thumbs, final output
format
9. checks destination folders to see if they exist, if not creates them
10. converts image to output desired
11. makes large web size and moves it to destination folder
12. makes thumb and moves it
13. deletes originals
14. checks upload folders (on separate hd) and looks for stay files and
deletes them if found
each step is reported back
here is an example from cfc on it
/*
****************************************************************************
***********************
CHECK MIME TYPE
check uploads mime type and error if not
accepted or continue procesing
****************************************************************************
***********************
*/
ckMimeTypeObj =
createObject("component","img_util").ckMimeType(
ckFile = locFile,
allowedMimeTypes =
variables.attributes.allowedMimeTypes
);
/*
****************************************************************************
***********************
MIME RESULTS
check upload mime results, show error and
stop processing or set var's and continue processing
****************************************************************************
***********************
*/
if(ckMimeTypeObj.status == 0){
result.status =
ckMimeTypeObj.status;
result.message =
ckMimeTypeObj.message;
writeOutput(SerializeJSON(result));
abortObj = createObject("component",
"cfc.utilities").abort();
} else {
var uploadedFileSize =
variables.attributes.maxUploadSize;
result.status =
ckMimeTypeObj.status;
result.message =
ckMimeTypeObj.message;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326294
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4