Selvakumar Ponnusamy
Selvakumar Ponnusamy

Reputation: 5563

Retain File Object valuie in a Form after File Upload

I have a form which has some input fields along with file object. Once the form is submitted, validation would happen in server side. If validation fails I need to show the same page to the user with the values he/she given. Im able to retain all the values except file object.

Is it possible in Playframework?

Upvotes: 0

Views: 134

Answers (1)

My Head Hurts
My Head Hurts

Reputation: 37675

Even if you could find a suitable way to send the file object back to the browser I do not believe it is possible to set the value of an <input type="file" /> due to security restrictions.

I would recommend validating the form in the browser first before uploading the data. If you do not want to write a load of validation code yourself then you could use a jquery validation plugin.

Upvotes: 1

Related Questions