Ciao Ragazzi,
ho bisogno di un vostro suggerimento. Come inserire durante l'UPLOAD un messaggio di attesa (ad es. "Stiamo valutando") con una barra sotto che avanza come quella dei download?
L'upload che utilizzo è quello completo di resize di immagini, utilizzando una pagina aspx (ricordo che io .NET non lo conosco, ma do solo in pasto alla pagina le informazioni che servono e poi provvede direttamente).
'Evito la memorizzazione in cache/proxy della pagina
response.expires = -1500
response.AddHeader "PRAGMA", "NO-CACHE"
response.CacheControl = "PRIVATE"
imgPath = Server.MapPath("\public\img_a") 'I suppose your images will be saved in an "img" folder which is child of the current folder
thumbPath = Server.MapPath("\public\thumb_a") 'I suppose your images will be saved in a "thumb" folder which is child of the current folder
%>
<%
'Dim pageUpload
pageUpload = "/pannello/u_immagini/upload.aspx"
%>
<script>
function uploadImgWindow(form, imgField, thumbField, imgPath, thumbPath, prev, imgWidth, imgHeight, thumbWidth, thumbHeight) {
var upload = window.open('<%=pageUpload%>?field=' + form + '.' + imgField + '&path=' + imgPath + (prev != '' ? '&prev=' + prev : '') + '&thumbField=' + form + '.' + thumbField + '&thumbPath=' + thumbPath + '&imgWidth=' + imgWidth + '&imgHeight=' + imgHeight + '&thumbWidth=' + thumbWidth + '&thumbHeight=' + thumbHeight, 'upload', 'toolbar=0,location=0,directories=0,status=0,menub ar=0,scrollbars=0,resizable=1,width=300,height=200 ');
upload.focus();
}
function controlli_formali()
{
if (document.theform.img.value == "")
{
alert ("Selezionare un'immagine");
return false;
}
else if (document.theform.descrizione.value == "")
{
alert ("Attenzione!!! Il campo TITOLO e' un campo obbligatorio");
document.theform.descrizione.focus()
return false;
}
else if (document.theform.concorso.selectedIndex == "0")
{
alert("ATTENZIONE! Il campo \"CONCORSO\" è un campo obbligatorio.");
document.theform.concorso.focus();
return false;
}
else
{
return true;
}
}
</script>
<form name="theform" method="post" action="aggiorna_immagini_con.asp" onSubmit="return controlli_formali()">
<table>
<tr>
<td align="right"><font face="Trebuchet MS" color="#3c3c3c" style="font-size:15px;">Foto:</font></td>
<td align="left">
<input readonly="readonly" name="img" class="auto-style7a" /><input type="hidden" name="thumb" />
<input type="button" class="auto-style7a" value="Scegli" onClick="uploadImgWindow(this.form.name, 'img', 'thumb', '<%= Server.URLEncode(imgPath) %>', '<%= Server.URLEncode(thumbPath) %>', this.form.img.value, 17, 14, 800, 600);" />
</td>
</tr>
<!-- I resize the image with the max with of 191 and the max height of 144.
I create a thumbnail with the max with of 120 and the max height of 92.-->
<tr>
<td align="right">
<font face="Trebuchet MS" color="#3c3c3c" style="font-size:15px;">Titolo:</font>
</td>
<td align="left">
<input type="text" name="descrizione" class="auto-style7a" size="50" maxlength="50" />
<input type="hidden" name="m" value="<%=Request("m")%>">
<input type="hidden" name="id_annuncio" value="<%=Request("id_annuncio")%>">
</td>
</tr>
<tr>
<td align="right">
<font face="Trebuchet MS" color="#3c3c3c" style="font-size:15px;">Concorso:</font>
</td>
<td align="left">
<select name="concorso" class="auto-style7a">
<option>Seleziona Concorso</option>
<%
SQL = "SELECT * From Concorsi Where Chiuso = 0 ORDER BY Tipologia, ID DESC"
set rs=Server.CreateObject("ADODB.recordset")
rs.Open SQL, conn, 3
if rs.EOF then
finito = 1
else
finito = 0
end if
Do While Not rs.Eof
%><option value="<%=SubCarSpeciali(RS("ID"))%>"><%=SubCarSpe ciali(RS("TIPOLOGIA")) %> - <%=SubCarSpeciali(RS("Titolo")) %></option><%
rs.movenext
Loop
rs.close
set rs = Nothing
%>
</select>
</td>
</tr>
<tr><td colspan="2"></td></tr>
<tr>
<td align="center" colspan="2">
<% if finito = 0 then %>
<input type="image" src="/images/invia.png" alt="Invia" title="Invia" />
<% else %>
<font face="Trebuchet MS" color="#3c3c3c" style="font-size:16px;">NESSUN CONCORSO APERTO</font>
<% end if %>
</td>
</tr>
</table>
</form>

Rispondi quotando
