Right, I managed to get step 1 of what I needed done thanks to you guys (
http://www.programmingtalk.com/showthread.php?t=25121), now it's step 2, hope someone can help here too!
This one is probably a bit more complicated,
I am using a FTP java applet for users to upload files to our server, hence my last post on creating a dir for each user. What I want to happen is for the applet to point to the correct folder for each user.
This is a bit of a problem, as the config file, which contains the url for the applet to point to is external. This means that I can obviously only have one setting.
But, according to their docs (
http://upload.thinfile.com/docs/dynamic.php) you can create a dynamic config file. I have managed to create this with no problem, now it will take the username and point it to the correct dir by using something like this;
Config file will be accessed by the applet in this manor;
I can then GET this information from the url, add it to the config file and it will point the applet to the correct directory (I will have to also add the str_replace command to change the spaces into underscores (as some usernames have spaces) as explained in my other topic).
Now, this is great. I've solved the problem haven't I?
NO!
As someone on another forum pointed out to me;
Quote:
|
How many people are going to use this system? What happens if someone starts an upload, but another user's connection changes the config file to something else? Do all users share the same config file, and are there going to be enough users that collisions like this will be a problem, or will only one person be likely to use it at once?
|
The chances are that lots of users will be using this at the same time (maybe not at the moment but certainly in the future).
My idea is to create a username_properties.php file on the fly, which I can access as mentioned above to get the correct url etc. Then, when the session ends, it deletes the file.
Is this possible? How would I go about doing this? How would I insure that the file was deleted, if for example the user closed the window and didn't log out?
If you can think of a better way of doing this, please let me know. I'm using this applet;
http://upload.thinfile.com/ftp/
The config file has (as far as I can see) to be external and only plain text.
Any help is appreciated.
Regards
Simon