Welcome Guest, Not a member yet? Register   Sign In
How to do an image upload like Wordpress (and other CMS's) do
#4

[eluser]BrianDHall[/eluser]
Ooo! Well here you go for the adding to text area javascript (one way to do it, anyway): http://www.mediacollege.com/internet/jav...-text.html

The question is then, how to get the path to your javascript function so it knows what to add to the text area. The easy way is if you are doing your upload the 'classic' way where the page as a whole is refreshed once the file is uploaded - then in your controller you just get the path to the uploaded file and pass it to your javascript.

If you want to do it all without a page refresh, that is a bit more complex javascript. You would want your javascript file uploader to upload the file, then get a response from the server of the path that was uploaded to. The javascript function would fire on file upload complete and read the response and set it as a variable that would then be available when the person clicked "insert into text field".


Messages In This Thread
How to do an image upload like Wordpress (and other CMS's) do - by El Forum - 10-05-2009, 09:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB