tracker issue : CF-3594414

select a category, or use search below
(searches all categories and all time range)
Title:

cffile uploadALL result bug

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Jerry Bucci / Jerry Bucci (JerryGB)

Created: 07/12/2013

Components: File Management

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / 287509

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 0

Problem Description: The Result attribute returns a Structure instead of an Array of Structures when an exception is thrown after processing 1 or more files successfully. The structure returned contains the results for the last successful upload, all other successful uploads are lost.
Example: If you are uploading 6 files and the sixth one throws an exception the Structure contains the results for the fifth file; the results for file 1-4 are lost.

Steps to Reproduce: 
1. Select more than one file to uploaded, preferably more than 2 to best illustrate the problem.
2. For one of the files choose one that doesn't meet the acceptable mime types specified in the Accept attribute. Make sure this file is a middle file in the browser's selection since the order of the upload maybe reversed.
3. The files preceding the exception upload successfully.
4. An exception is thrown for the file with the not acceptable mime type.

Actual Result: When this occurs the Result returned is a Structure which contains the results for the last successfully processed file.

Expected Result: "After a file upload is completed, this tag creates an array of structures specified by the result parameter. Each structure in the array contains upload result information for one file." As per the documentation.

Any Workarounds: None.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3594414

Deployment Phase:	Release Candidate

External Customer Info:
External Company:  
External Customer Name: JerryGB
External Customer Email:  
External Test Config: My Hardware and Environment details: Intel Server, 16GB Memory; Windows Server 2012 64 bit.

Attachments:

Comments:

If you are uploading only one file and an exception is thrown, Result is an empty Array. This is good. If you are uploading more than one file and an exception is thrown on the first file, Result is an empty Array. This is good too.
Comment by External U.
14986 | July 12, 2013 12:25:12 PM GMT
Hey Jerry, <cffile action="uploadall" destination="C:\sample" nameconflict="overwrite" result="res" accept="text/plain,application/xml,application/pdf"> If the above code throws an exception , then the res(result="res") is not created. Do you want res structure to be created for the successfull uploads while uploading multiple files even when one of them does not match the given mime types? I am attaching the required code.
Comment by Suchika S.
14987 | September 24, 2013 04:51:05 AM GMT
Hi Suchika, According to the documentation the Result is an Array of Structures. It should return an Array regardless of 1 upload or many uploads. Each structure in the Array is a Result structure as defined in documentation for [cffile action = "upload"]. I don't agree with your statement "If the above code throws an exception , then the res(result="res") is not created." In my tests the res(result="res") would be an empty Array. See my notes on July 12, 2013. I want the res(result="res") to always be an Array and to contain Result Structures of ALL successful uploads BEFORE the exception occurred. Here is the "EXPECTED" behavior... res(result="res") is an Array at all times. upload 1 file, success cnt = 0, exception = yes, exception file# = 1, result = Empty Array upload 1 file, success cnt = 1, exception = no, exception file# = 0, result = Array of 1 Result Struct (file #1) upload 2 files, success cnt = 0, exception = yes, exception file# = 1, result = Empty Array upload 2 files, success cnt = 1, exception = yes, exception file# = 2, result = Array of 1 Result Struct (file #1) upload 2 files, success cnt = 2, exception = no, exception file# = 0, result = Array of 2 Result Struct (file #1 & 2) upload 4 files, success cnt = 0, exception = yes, exception file# = 1, result = Empty Array upload 4 files, success cnt = 1, exception = yes, exception file# = 2, result = Array of 1 Result Struct (file #1) upload 4 files, success cnt = 2, exception = yes, exception file# = 3, result = Array of 2 Result Struct (file #1 & 2) upload 4 files, success cnt = 3, exception = yes, exception file# = 4, result = Array of 3 Result Struct (file #1, 2 & 3) upload 4 files, success cnt = 4, exception = no, exception file# = 0, result = Array of 4 Result Struct (file #1, 2, 3 & 4) Here is the current "ERRONEOUS" behavior... res(result="res") is NOT an Array at all times and loses successful results when an exception occurs. upload 1 file, success cnt = 0, exception = yes, exception file# = 1, result = Empty Array upload 1 file, success cnt = 1, exception = no, exception file# = 0, result = Array of 1 Result Struct upload 2 files, success cnt = 0, exception = yes, exception file# = 1, result = Empty Array upload 2 files, success cnt = 1, exception = yes, exception file# = 2, result = Not Array; Result Struct (file #1) upload 2 files, success cnt = 2, exception = no, exception file# = 0, result = Array of 2 Result Struct (file #1 & 2) upload 4 files, success cnt = 0, exception = yes, exception file# = 1, result = Empty Array upload 4 files, success cnt = 1, exception = yes, exception file# = 2, result = Not Array; Result Struct (file #1) upload 4 files, success cnt = 2, exception = yes, exception file# = 3, result = Not Array; Result Struct (file #2); No results for file #1 upload 4 files, success cnt = 3, exception = yes, exception file# = 4, result = Not Array; Result Struct (file #3); No results for file #1 & 2 upload 4 files, success cnt = 4, exception = no, exception file# = 0, result = Array of 4 Result Struct (file #1, 2, 3 & 4)
Comment by External U.
14988 | September 24, 2013 01:24:25 PM GMT
Note below specifies the changes that the customer wants.
Comment by Suchika S.
14989 | September 25, 2013 12:57:28 AM GMT