• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File Upload

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a form in which user can attach files and fill the details in the form and submit. He can attach any number of files and can delete the attached files. Once he attaches files, it will be displayed and he will fill the rest of the form and submits. The problem is i dont know how to handle this scenario. I came up with two ideas.
1. On attaching the file store it temp. in a table in database. Once the user fills the rest of the form and submit save it to the main table. The problem in this apporach if he going to cancel the form then i wnt to delete the attached files, it can be done if he clicks on the cancel button. But he closes browser clicks on some other thing in the menu i could not handle.
2. Display only the file name and on submit based on the path get the data, but in this case how to handle this because on submission of the form only the path goes to the server and u cant retreive it.

Anybody could suggest a better idea for solving this i could be great help for me.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as the user canceling. Assign each user a unique id into session, use this to track 'temporary' files. Create session listener that deletes all temporary files of the unique id when session is destroyed.
 
No thanks. We have all the government we need. This tiny ad would like you to leave now:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic