Django Show user that loading is in progress

I have a filemanager application that allows users to upload files to a server and, of course, upload them. Now in a state when the user starts downloading the browser, only shows that a small circle of downloads until the download is complete. And the use of this server will be for fairly large files, mostly around 100 MB, so it may take some time, and inexperienced users can start browsing when downloading and destroying.

I looked in progressbars, but I'm not such a strong encoder, and it will take me some time to implement this in the filemanager application. A time that I may not have. I was thinking of a notification for the user, for example, in a warning window with the text: "Download, please wait!" while it loads, and the window will disappear when the download is complete. I already tried using the javascript warning window, but it just requires the user to click ok, and then he does the same.

def upload(request):
if request.POST:
    post_data = request.POST.copy()

if not post_data.get('path'):
        return raise_error(request,
            [_(u"No path given")])
    if not post_data['path'].startswith(request.user.fileman_Setting.root):
        return raise_error(request,
            [_(u"No access")])

    post_data.update(request.FILES)
    form = UploadForm(post_data)
    if form.is_valid():
       form.save(request.FILES, request)
       return HttpResponseRedirect('/fm/list/%s' % form.path)
    else:
        return raise_error(request,
            form.errors)
else:
    return raise_error(request,
            [_(u"Empty form.")]) 

Any ideas how I could implement something to notify the user that he is loading and he should wait? Something easier than progress. I was thinking about using this HttpResponseRedirect at the end as a mark that the download is complete, can I do something with this along with something else?

+3
1
+1

All Articles