doddsey_65 Posted March 2, 2011 Share Posted March 2, 2011 ok im stuck again and need help. I have gotten rid of the attachment system(too many issues) on ASF and decided to replace it with my own. The problem is that the original new post form is sent to php via jQuery. Obv i cannot do this with files so the attachment section needs to be a seperate form. Now i have no issues with sending files to the folder and sending their name to the database but i need to send multiple. so far when the user selects a file it will add the name of it to a hidden input element and each one that is added to that element is seperated with | . then in the php i would use explode on this element to get an array of the file names. but this only helps when sending to the database and not when moving files. I also dont want a page refresh when uploading files. No other file upload systems out there will work because they upload the file as soon as you press submit, but then how do i add the post id to the attachments row in the database? Quote Link to comment https://forums.phpfreaks.com/topic/229408-file-uploading/ Share on other sites More sharing options...
n3r0x Posted March 2, 2011 Share Posted March 2, 2011 Not sure if i get you right.. but wouldn´t it be possible to return the postid using jquery/ajax from submitting first form add it into a hidden input in the attachment form the submitting those? [*]User press submit [*]form 1 sends all information [*]On success jquery receives postid and updates the hidden value On Fail halt and display error(s) [*]form 2 with attachments are sent [*]User gets redirected to post Quote Link to comment https://forums.phpfreaks.com/topic/229408-file-uploading/#findComment-1181991 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.