I'm using nginx + upload_progress module On the HTML page for progress bar I'm using iframe + ajax u can find a result here http://fex.cc
On Thursday, March 3, 2016 at 9:23:53 PM UTC+2, [email protected] wrote: > > Hoping that this network can help me out even though this is not strictly > django-related, otherwise can someone recommend a group other than stack > overflow that could help here? > > I have a functioning upload function implemented in django. The files > being handled are large making for a long waiting time and so I would like > to provide a "Please Wait/ Loading.../ GIF" on the page while the files are > loading. > > The HTML/Django that begins the uploading function is as follows: > > <p><input type="submit" value="Upload" id="Upload" onclick = > "showMessage()"/></p> > > The upload button is as follows (accompanied by a hidden div): > > <div class="up" id="up" style="display:none;"> > <img src="{% static 'img/ajax-loader.jpg' %}" alt="loading"/> > </div> > > I took some example code and tried to adapt it to the above HTML but it's > not showing up on the page at all during the loading time... and I have no > errors to follow. > > The ajax: > > <script>function showMessage() { > $('.up').show()// document.getElementById("up").innerHTML = "please > wait";}</script> > > However my ajax code is not having any effect as the hidden div does not > appear after clicking "Upload". > > I am not at all familiar with Ajax/javascript and so while I understand > that I can see that I am able to set a function "showMessage" and then upon > clicking "Upload" the function will be called should render the hidden div > to the page until the output is complete and rendered to the output page. > > I should also mention that before I decided to use a GIF I successfully > managed to get a "Please wait" message to appear after clicking the > "Upload" button (this code is silenced in the "showMessage" function above. > > The problem is that the "Please Wait" message actually over-rides the > rendering to the output page and hence the results of the upload do not > display when processed. > > Hence overall I just want a hidden div to render to the input page until > the output is complete and in a way that will not conflict with the more > important, subsequent rendering to the output page. > > The syntax I'm using is not having any effect on the page so I'm hoping > someone can correct my misguided code. > > Thanks > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4c94ba7e-b07a-4cfa-82be-5dff6e5806ce%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

