Hi,
when I call getUploadedFile("uploadfile") in my DMI, it returns null and in the log (see blow), there is a warning with "No such type 'binary'".
Log
I use the power version: SC_SNAPSHOT-2011-03-28/PowerEdition Deployment 2011-03-28
My Datasource looks as follows:
My DMI looks as follows:
And my Client Code looks as follows:
when I call getUploadedFile("uploadfile") in my DMI, it returns null and in the log (see blow), there is a warning with "No such type 'binary'".
Log
Code:
=== 2012-01-31 13:16:36,443 [or23] DEBUG RPCManager - Processing 1 requests. === 2012-01-31 13:16:36,443 [or23] DEBUG RPCManager - Request #1 (DSRequest) payload: { values:{ uploadfile:"C:\\upload_template.csv" }, operationConfig:{ dataSource:"FILE_UPLOAD", operationType:"add" }, componentId:"isc_DynamicForm_1", appID:"builtinApplication", operation:"FILE_UPLOAD_add", oldValues:{ }, criteria:{ } } === 2012-01-31 13:16:36,443 [or23] INFO IDACall - Performing 1 operation(s) === 2012-01-31 13:16:36,443 [or23] WARN Validation - No such type 'binary', not processing field value at /FILE_UPLOAD/uploadfile === 2012-01-31 13:16:36,443 [or23] INFO FileUploadDMI - appendErrorMessage: You must speciffy a valid file! === 2012-01-31 13:16:36,443 [or23] INFO DSResponse - DSResponse: Map with 1 keys === 2012-01-31 13:16:36,443 [or23] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8 === 2012-01-31 13:16:36,443 [or23] DEBUG RPCManager - DMI response, dropExtraFields: true
My Datasource looks as follows:
Code:
<DataSource ID="FILE_UPLOAD" serverType="generic"> <fields> <field name="uploadfile" title="File" type="binary" required="false" showFileInline="true"></field> <field name="message" type="enum" required="false" hidden="true"></field> </fields> <serverObject lookupStyle="new" className="cpce.server.tmobviplist.FileUploadDMI" /> </DataSource>
Code:
public class FileUploadDMI { ... public DSResponse add(DSRequest record, HttpServletRequest req, HttpServletResponse resp) throws Exception { ISCFileItem file = record.getUploadedFile("uploadfile"); if(file == null){ appendErrorMessage("You must speciffy a valid file!"); } ...
Code:
uploadForm = new DynamicForm(); uploadForm.setTop(5); uploadForm.setAutoHeight(); uploadForm.setNumCols(3); uploadForm.setDataSource(DataSource.get("FILE_UPLOAD")); ... UploadItem fileItem = new UploadItem("uploadfile"); fileItem.setWidth(500); uploadForm.setFields(fileItem );
Comment