[OSM-dev] Dev&svn accounts

Shaun McDonald shaun at shaunmcdonald.me.uk
Fri Mar 7 22:21:52 GMT 2008


On 7 Mar 2008, at 14:32, Tom Hughes wrote:

> In message <6B809AF0-94A6-4D59-90DE-861E6706D715 at shaunmcdonald.me.uk>
>        Shaun McDonald <shaun at shaunmcdonald.me.uk> wrote:
>
>> On 7 Mar 2008, at 14:01, Tom Hughes wrote:
>>
>>> I may be being dense here, but what's the problem with a user
>>> uploading a second file with the same name?
>>
>> All my traces currently have a unique name as produced by the gps
>> [software], thus I see it to be unlikely to be an issue.
>> Just to clarify the restriction is on a user-by-user basis, not  
>> system
>> wide. So every user can upload a trace with the same name. However I
>> cannot upload a trace to my account twice.
>> In database terms it would be a unique key on two columns (user id,
>> trace name), rather than just one column (trace name).
>
> Yes, but you're still imposing that on all the users for your
> personal convenience!
>

After some discussion on IRC I realised that my use case of the GPX  
upload is the complete opposite from others who regularly upload the  
same filename.

>> The problem I currently have is that I have uploaded some of my
>> traces, but don't want to upload lots of duplicate points. Currently
>> the only way to prevent duplicates is to manually go through your  
>> list
>> of traces to see if you have uploaded it already. This is very time
>> consuming. Why not get the computer to do that difficult and time
>> consuming job?
>
> Well yes, but why should the server have to do that for everybody
> especially when you have to send the whole file over the network
> before it can decide whether it wants it or not.

Richard suggested using AJAX to display a message to the user as to  
whether they have uploaded the file before. This would give the best  
of both worlds. Those who upload the same file name all the time can  
just ignore it, while people like me who want to know that I have  
uploaded before will be able to make use of the message without  
needing to send the whole file to the server.

A preference in the user profile could be used to determine whether  
the javascript for checking if the file is to be used.

1. User selects file
2. AJAX Javascript goes to the server and asks if the filename has  
been uploaded before.
3. If it has then update a div to tell the user, otherwise tell the  
user that it has not been uploaded yet.
4. User enters the other information to tag the file.
5. User hits the upload button and it starts the upload in the  
background, clears the form, and adds an items about the current trace  
to the page through AJAX. Then the user can start on the next trace  
while the last one is uploading, without full page reloads.

Does this keep all users happy?

>
>
> I'm not sure you should really be reading that much information
> into the filename sent with a file upload anyway - it's really
> more of a "suggested server filename" than necessarily the name
> of the file on the client (though most if not all browsers do
> just send the name of the local file).
>
>> All my traces are in monthly folders, so it would allow me to  
>> upload a
>> month at a time. It could be extended so that a text description file
>> is included to tell you about the traces. This would then be faster
>> than uploading the traces individually.
>
> I don't understand what uploading descriptions has to do with any
> of this...

It was an extension of the batch upload that is an unrelated idea that  
I had.


Shaun





More information about the dev mailing list