Hi!
I have recently added the option of attaching files to my email component.I have a question:what should I use so that after the user attaches the files he can contnue to write the message.What should I do to retain the text?
Using the File input type doesn't require them to leave the page and come back. You only need that page change if you want to upload the file in a separate page load from the final submission of the email. If that is the case, then you will need the user to browser for their file, then do something to post the page. If your not going to do this in a popup or in a separate page then it might seem a little awkward to them to have to push two buttons to attach a file.
Separate Page:
Basically you would have an "attach" button on your email interface that is a submit button. Pressing this button submits the form to the next page to allow them to attach files. The next page writes all the posted values from the email to hidden fields and presents the user with file inputs to browse to files. Once they finish selecting files, they press a "back to email" button which submits all of the information back to the email page. You then need to handle the file uploads and put them somewhere until later, as well as re-filling out the form from the originally submitted email information and the attached email section (and hidden inputs) with the filenames they uploaded. When they hit the send button you will need to go get the uploaded attachments you stored somewhere based on the names or id's in your hidden fields and you will have everything you need to send the email.
You will probably want to build some sort of protection into the system, such as flagging their account when they are working on a draft, so that you can warn them or clean up after them after they attach a bunch of files and don't send the email. You would also need to work something out to make sure you don't overwrite one persons "myfile.txt" with another persons "myfile.txt" while your waiting for the original person to finish typing their email.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.