This content has been marked as final. Show 7 replies
You can't return the new filename using the FileReference object so you need a workaround. From what you posted here I can't put my finger on the right solution but to illustrate:
I needed a solution as part of a form where the user would provide name, email and so on and could upload a c.v. Before the file upload I used a LoadVars (and used the sendAndLoad() method) object to post the data from the form and return the record_id from the database. In the onLoad event of the LoadVars object I used the FileReference object to handle the upload, calling an upload script and added the record_id as a get variable. The record_id was then used to save the new filename of the uploaded file to the database.
If this is not feasible in your situation, elaborate on the topic by describing your scenario in more detail.
hmm gonna try this now.
I think it should work for me as well but I'll get back to you.
Thanks for your reply.
hmm seems to be working. the downside of this method is that if for some reason the upload would fail i would still have the information in my database but i'll find a workaround for that as well :-)
thanks for your help
Once you have the record_id in Flash, you can use the events of the FileReference object and again use a LoadVars object there to delete the record from the database.
I know, but that way i'll have to talk to my db 2 times instead of 1.
Since this is my first time developping for a pretty big amount of visitors (+-30 000/month) and i don't really have an idea how this will affect my db speeds i'm trying to limit the communications between flash and my db.
Do you have any remarks or hints for using the filereference object or database communication with this amount of users?
True, but that's only going to happen when the upload fails.
Assuming you use a real database, that amount of visitors shouldn't be a problem. When it comes to 30,000 a day...
You could rename the file in flash. Then send the new name to your php script using GET