Welcome Guest, Not a member yet? Register   Sign In
Upload Image
#2

[eluser]Rok Biderman[/eluser]
Upload is a form like any other, so it submits, reloads and obviously you lose all data in the fields. I see three ways to work around it.

One is to do a ajax upload, so the page doesn't refresh. It isn't hard, but what makes it tricky is if you have to send any additional info/processing. I just haven't found any decent upload scripts around, and I most certainly suggest you keep away from those that use swfupload scripts like uploadify. Making it work with CI (like a flash session bug fix) is an absolute nightmare and flash is impractical for debugging.

The second is to send the data along with the upload request and repopulate it later. So, you would grab put both file upload and textarea info. The in controller if file variable is empty, you put text values into database (or whatever), but if the file post variable is not empty, you do the upload event, and then use the rest of the info to repopulate the form.

The third option is as you mentioned a popup or iframe/modal popup (some ajax uploads are an masked iframe form anyway).


Messages In This Thread
Upload Image - by El Forum - 08-16-2011, 08:33 AM
Upload Image - by El Forum - 08-16-2011, 09:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB