I am using WPF 7.0. In my model I have used the File Upload builder. I need to restrict the some of file format with that File upload builder. I do not want upload those file which list provided by user.
For this purpose I did the validation on front end. It's working good. As per user view file did not get uploaded. But in actual File is uploaded at server end. So need to restrict those file. Those will get uploaded at server end It's my requirement.

Re: How to restrict specific file format with File upload builder.

Verifying as much as you can in JS on the client/browser is a good thing, to reduce accidental uploads of incorrect files.

For security reasons, like data validation, you should definitely validate inputs on the server, in case someone bypasses the Javascript based validation.

Just as a banking app (built with any tool) should validate banking data inputs (eg, a debit value should not be negative or greater than the current account balance) before executing a debit operation, you should validate your file upload data to your app's criteria before doing anything with it.

The upload folder in the WAR is meant to be a "temporary" location for file uploads, where your app validates the files uploaded and determines whether they're valid to keep and then where to move them if they're acceptable to the application. You definitely don't want to keep them in the temporary location, as the WAR contents will get replaced if you redeploy the WAR with updates.

If you search for "File Upload" in the forum search box above, you'll find numerous threads with tips/suggestions for using the file upload builder and support with WEF.

I hope that info helps,
..Mike Burati
http://www-10.lotus.com/ldd/pfwiki.nsf/
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

Re: How to restrict specific file format with File upload builder.

Verifying as much as you can in JS on the client/browser is a good thing, to reduce accidental uploads of incorrect files.

For security reasons, like data validation, you should definitely validate inputs on the server, in case someone bypasses the Javascript based validation.

Just as a banking app (built with any tool) should validate banking data inputs (eg, a debit value should not be negative or greater than the current account balance) before executing a debit operation, you should validate your file upload data to your app's criteria before doing anything with it.

The upload folder in the WAR is meant to be a "temporary" location for file uploads, where your app validates the files uploaded and determines whether they're valid to keep and then where to move them if they're acceptable to the application. You definitely don't want to keep them in the temporary location, as the WAR contents will get replaced if you redeploy the WAR with updates.

If you search for "File Upload" in the forum search box above, you'll find numerous threads with tips/suggestions for using the file upload builder and support with WEF.

I hope that info helps,
..Mike Burati
http://www-10.lotus.com/ldd/pfwiki.nsf/
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

I'm not sure what you mean by "the link". If you search for File Upload in the forum above, you will find other previous threads recommending that you should check the uploaded file and then move them somewhere more permanent. There's no link to something that does it for you, your application action that is called on the upload should call Java LJO/Method code that you write that checks whatever you want to check about the file and then moves it (in the filesystem or to a DB) to a more permanent place.

I hope that info helps,
..Mike Burati
http://www-10.lotus.com/ldd/pfwiki.nsf/
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

Re: How to restrict specific file format with File upload builder.

I'm not sure what you mean by "the link". If you search for File Upload in the forum above, you will find other previous threads recommending that you should check the uploaded file and then move them somewhere more permanent. There's no link to something that does it for you, your application action that is called on the upload should call Java LJO/Method code that you write that checks whatever you want to check about the file and then moves it (in the filesystem or to a DB) to a more permanent place.

I hope that info helps,
..Mike Burati
http://www-10.lotus.com/ldd/pfwiki.nsf/
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

Actually, I meant by "The link" is forum thread. I have already implemented the File format validation and file move implementation. But the thing is that on screen It's shows the message that please select write file format which is defined by client. But in actual file get uploaded at server side. This is the problem.

Re: How to restrict specific file format with File upload builder.

Actually, I meant by "The link" is forum thread. I have already implemented the File format validation and file move implementation. But the thing is that on screen It's shows the message that please select write file format which is defined by client. But in actual file get uploaded at server side. This is the problem.

If you've implemented your own app specific file format validation and move implementation, then I would think you would want to have that code remove the file if it does not meet your application's criteria for an acceptable uploaded file, before returning an error to the user.

I hope that info helps,
..Mike Burati
http://www-10.lotus.com/ldd/pfwiki.nsf/
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.