问题
We have a form where user can submit a message, as well as upload 1-10 files (not displayed in-line in the message, but as links at the bottom of the message).
This is all working fine so far... using two separate forms.
1 x form (MAIN/parent form) is the message details form (name. date, message..etc)
1 x form that is under this form, and if for handling the selected/uploading of user selected files.
This is done through a hidden iFrame and dedicated php script, and returns a list of uploaded file names/paths back to the MAIN/parent form (as hidden fields).. so when the MAIN/parent form is submitted.. all the data get saved to the database at one time, and the image/file uploading event/portion wont cause any loss of message data if there is timeout or other uploading error.
This is all working so far.
What I am not clear about or stuck on... is that for each message post the message 'owner/poster' can go back and edit the message..
This should include letting the user edit the files uploaded/attached to the post as well. Which I'm not sure how I should be handling? or a nice and easy to do this?
I'm guessing I'll have to do the 'two form' approach I use for the initial posting/uploading of the message?.. but how can I pre-populate the file input fields? DO I just pre-populate the value with the file name/path form the DB.. ?
来源:https://stackoverflow.com/questions/26597559/editing-user-uploaded-files