Событие asp.net FileUpload после выбора сделано и прежде чем отправят для загрузки

Подводя итог:

Kubernetes использует функцию kube-proxy для обработки виртуальных IP-адресов для сервисов. Kubernetes распределяет задачи для модулей внутри службы с помощью метода циклического перебора

При распределении с разбивкой по кругам система поддерживает список адресатов. Когда поступает запрос, он назначает запрос следующему получателю в списке, а затем переставляет список (простым ротацией или более сложным способом), поэтому следующий запрос отправляется следующему получателю в списке. [112 ]

@ c4f4t0r абсолютно прав, что, как только вы начнете сеанс загрузки файла, вы будете использовать тот же модуль и соединение. В случае, если что-то случится с текущим подключением (pod down) - следующий сеанс будет установлен со следующим в циклическом модуле.

8
задан John Adams 6 May 2009 в 18:19
поделиться

1 ответ

The problem is that there's no way to find out the size of file on the client side without posting back. You could use Ajax, but that would mean uploading the file first anyway.

This can only be done using an ActiveX control of some kind. I would recommend using something like the Silverlight FileUploader because it gets the size of the file before posting back and even has a nice progress indicator.

UPDATE: If you want to trigger a postback or Ajax Request after the user clicks browse, the client side event is "onchange". Here's an example of how to use the onchange event.

<asp:FileUpload runat="server" 
    onchange="alert('you selected the file: '+ this.value)" />

You could have the onchange, trigger an ajax to upload the file first and then update a label showing the size of the file. The problem with this is that if it is a large file, it defeats the purpose of letting the user know before hand that it will take a long time.

Here's another recommendation: There's a jQuery plugin that uses flash to determine the size of the file before uploading and it's very easy to use. Check it out at jQuery Uploadify

14
ответ дан 5 December 2019 в 12:12
поделиться
Другие вопросы по тегам:

Похожие вопросы: