Torna indietro   Hardware Upgrade Forum > Software > Programmazione

ASUS Expertbook PM3: il notebook robusto per le aziende
ASUS Expertbook PM3: il notebook robusto per le aziende
Pensato per le necessità del pubblico d'azienda, ASUS Expertbook PM3 abbina uno chassis particolrmente robusto ad un pannello da 16 pollici di diagonale che avantaggia la produttività personale. Sotto la scocca troviamo un processore AMD Ryzen AI 7 350, che grazie alla certificazione Copilot+ PC permette di sfruttare al meglio l'accelerazione degli ambiti di intelligenza artificiale
Test ride con Gowow Ori: elettrico e off-road vanno incredibilmente d'accordo
Test ride con Gowow Ori: elettrico e off-road vanno incredibilmente d'accordo
Abbiamo provato per diversi giorni una new entry del mercato italiano, la Gowow Ori, una moto elettrica da off-road, omologata anche per la strada, che sfrutta una pendrive USB per cambiare radicalmente le sue prestazioni
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design
OnePlus 15 nasce per alzare l'asticella delle prestazioni e del gaming mobile. Ma non solo, visto che integra un display LTPO 1,5K a 165 Hz, OxygenOS 16 con funzioni AI integrate e un comparto foto con tre moduli da 50 MP al posteriore. La batteria da 7.300 mAh con SUPERVOOC 120 W e AIRVOOC 50 W è la ciliegina sulla torta per uno smartphone che promette di offrire un'esperienza d'uso senza alcun compromesso
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 13-07-2005, 15:27   #1
Matrixbob
Senior Member
 
L'Avatar di Matrixbob
 
Iscritto dal: Jul 2001
Messaggi: 9947
[JSP] File upload: qualcuno lo sa fare?!

In PHP son riuscito a capire come farlo, ma dovrei implementarlo in JSP.
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<<
Più largo è il sorriso, più affilato è il coltello.
Matrixbob è offline   Rispondi citando il messaggio o parte di esso
Old 13-07-2005, 18:44   #2
DigitalKiller
Senior Member
 
L'Avatar di DigitalKiller
 
Iscritto dal: Aug 2004
Città: Salento
Messaggi: 1080
Ho fatto una rapida ricerca su google, prova questo

Ultima modifica di DigitalKiller : 09-07-2010 alle 17:43.
DigitalKiller è offline   Rispondi citando il messaggio o parte di esso
Old 14-07-2005, 10:09   #3
Angus
Senior Member
 
L'Avatar di Angus
 
Iscritto dal: Dec 2001
Città: Milano
Messaggi: 545
vedi anche Jakarta Commons FileUpload
__________________
Angus the Hunter @ Realm of magic | Angus Young @ Batracer
°SetiEmperor°| Ninja Technologies
{ qualunque cosa sia, è veloce e fa male (cit.) }
Angus è offline   Rispondi citando il messaggio o parte di esso
Old 14-07-2005, 10:29   #4
Matrixbob
Senior Member
 
L'Avatar di Matrixbob
 
Iscritto dal: Jul 2001
Messaggi: 9947
Quote:
Originariamente inviato da DigitalKiller
Ho fatto una rapida ricerca su google, prova questo
Questo lo avevo già trovato su google, insieme anche a questo:
Codice:
Hello Guys,

I have tried this example and successfully load the file on the server.

-----------------Form.html-------------------------------------------

<form action="upload.jsp" method="POST" enctype="multipart/form-data">
<!-- enctype="multipart/form-data" -->
<input type="file" name="theFile"><br>

<input type="submit">
</form>

------------------------------ upload.jsp --------------------------------------------
<!-- upload.jsp -->
<%@ page import="java.io.*" %>

<%
String contentType = request.getContentType();
System.out.println("Content type is :: " +contentType);
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();

byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength) {
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
}

String file = new String(dataBytes);
String saveFile = file.substring(file.indexOf("filename=\"") + 10);
//out.print("FileName:" + saveFile.toString());
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
//out.print("FileName:" + saveFile.toString());
saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
//out.print("FileName:" + saveFile.toString());

//out.print(dataBytes);

int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1,contentType.length());
//out.println(boundary);
int pos;
pos = file.indexOf("filename=\"");

pos = file.indexOf("\n", pos) + 1;

pos = file.indexOf("\n", pos) + 1;

pos = file.indexOf("\n", pos) + 1;


int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
saveFile = "C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\ROOT\\Extrusions\\" + saveFile;
FileOutputStream fileOut = new FileOutputStream(saveFile);


//fileOut.write(dataBytes);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush();
fileOut.close();

out.println("File saved as " +saveFile);

}
%>

As you can see the path in Extrusions this is the path where I can save the files.
It will work, I am sure please try as it is.

Raheel Rehman
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<<
Più largo è il sorriso, più affilato è il coltello.
Matrixbob è offline   Rispondi citando il messaggio o parte di esso
Old 14-07-2005, 10:30   #5
Matrixbob
Senior Member
 
L'Avatar di Matrixbob
 
Iscritto dal: Jul 2001
Messaggi: 9947
Grazie, + avanti ritornonerò su questo argmento, ora devo portare avanti un'altra faccenda
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<<
Più largo è il sorriso, più affilato è il coltello.
Matrixbob è offline   Rispondi citando il messaggio o parte di esso
Old 14-07-2005, 10:33   #6
Matrixbob
Senior Member
 
L'Avatar di Matrixbob
 
Iscritto dal: Jul 2001
Messaggi: 9947
Oppure questo bean:
Codice:
//ÎļþÄÚÈÝ

i = in.readLine(line, 0, 1280);
setContentType(new String(line, 0, i-2));
i = in.readLine(line, 0, 1280);

//¿ÕÐÐ
i = in.readLine(line, 0, 1280);
newLine = new String(line, 0, i,"ISO8859_1");
FileOutputStream pw=new FileOutputStream((savePath==null? "" : savePath) + filename);
//PrintWriter pw = new PrintWriter(new BufferedWriter(new
//FileWriter((savePath==null? "" : savePath) + filename)));
while (i != -1 && !newLine.startsWith(boundary)) {
// ÎļþÄÚÈݵÄ×îºóÒ»Ðаüº¬»»ÐÐ×Ö·û
// Òò´ËÎÒÃDZØÐë¼ì²éµ±Ç°ÐÐÊÇ·ñÊÇ×î
// ºóÒ»ÐÐ
i = in.readLine(line, 0, 1280);
if ((i==boundaryLength+2 || i==boundaryLength+4) && (new String(line, 0, i).startsWith(boundary)))
pw.write(newLine.substring(0, newLine.length()-2).getBytes("ISO8859_1"));
else
pw.write(newLine.getBytes("ISO8859_1"));
newLine = new String(line, 0, i,"ISO8859_1");
}
pw.close();
}
else {
// ÆÕͨ±íµ¥ÊäÈëÔªËØ
// »ñÈ¡ÊäÈëÔªËØÃû×Ö
int pos = newLine.indexOf("name=\"");
String fieldName = newLine.substring(pos+6, newLine.length()-3);
i = in.readLine(line, 0, 1280);
i = in.readLine(line, 0, 1280);
newLine = new String(line, 0, i);
StringBuffer fieldValue = new StringBuffer(1280);
while (i != -1 && !newLine.startsWith(boundary)) {
// ×îºóÒ»Ðаüº¬»»ÐÐ×Ö·û
// Òò´ËÎÒÃDZØÐë¼ì²éµ±Ç°ÐÐÊÇ·ñÊÇ×îºóÒ»ÐÐ
i = in.readLine(line, 0, 1280);
if ((i==boundaryLength+2 || i==boundaryLength+4) && (new String(line, 0, i).startsWith(boundary)))
fieldValue.append(newLine.substring(0, newLine.length()-2));
else
fieldValue.append(newLine);
newLine = new String(line, 0, i);
}
fields.put(fieldName, fieldValue.toString());
}
}
i = in.readLine(line, 0, 1280);
}

}

}


--jsp1.jsp

<%@ page contentType="text/html;charset=gb2312"%>
<jsp:useBean id="TheBean" scope="page" class="FileUploadBean.FileUploadBean" />
<%
TheBean.setSavePath("d:\\"); 
TheBean.doUpload(request);
out.println("Filename:" + TheBean.getFilename());
out.println("<BR>ContentType:" + TheBean.getContentType());
out.println("<BR>Author:" + TheBean.getFieldValue("author"));
out.println("<BR>Company:" + TheBean.getFieldValue("company"));
out.println("<BR>Comment:" + TheBean.getFieldValue("comment"));
%>

-- jload.html
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>File Upload Demo </title>
</head> 
<body>
<form action=jsp1.jsp enctype="MULTIPART/FORM-DATA" method=post>
Author: <input type=text name=author>
<br>
Company: <input type=text name=company>
<br>
Comment : <textarea name=comment></textarea>
<br>
Choose the upload file <input type=file name=filename>
<br>
File description : <input type=text name=description>
<br>
<input type=submit value="Upload">
</form>
</body>
</html>
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<<
Più largo è il sorriso, più affilato è il coltello.
Matrixbob è offline   Rispondi citando il messaggio o parte di esso
Old 19-07-2005, 18:31   #7
Matrixbob
Senior Member
 
L'Avatar di Matrixbob
 
Iscritto dal: Jul 2001
Messaggi: 9947
Non li ho ancora provati, forse non li uso, ma se li provo cerco di ricordare d'aggiornare questo 3D per i posteri.

3D inerenti:
[JSP/SERVLET] Upload di file su WEB
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<<
Più largo è il sorriso, più affilato è il coltello.

Ultima modifica di Matrixbob : 03-09-2005 alle 15:01.
Matrixbob è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


ASUS Expertbook PM3: il notebook robusto per le aziende ASUS Expertbook PM3: il notebook robusto per le ...
Test ride con Gowow Ori: elettrico e off-road vanno incredibilmente d'accordo Test ride con Gowow Ori: elettrico e off-road va...
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design   Recensione OnePlus 15: potenza da vendere e batt...
AMD Ryzen 5 7500X3D: la nuova CPU da gaming con 3D V-Cache per la fascia media AMD Ryzen 5 7500X3D: la nuova CPU da gaming con ...
SONY BRAVIA 8 II e BRAVIA Theatre System 6: il cinema a casa in formato compatto SONY BRAVIA 8 II e BRAVIA Theatre System 6: il c...
Bonus Elettrodomestici 2025, si parte: c...
Jeff Bezos torna al comando, stavolta di...
Anthesi sceglie OVHcloud per digitalizza...
Cube presenta Trike Flatbed Hybrid 750, ...
Call of Duty Black Ops 7 peggio di Infin...
L'Italia è il secondo mercato per...
Wi-Fi superveloce anche in giardino? FRI...
La Ford Focus va ufficialmente in pensio...
Booking.com integra Revolut Pay: nasce i...
DGX Spark a 175 fps con ray tracing su C...
Red Dead Redemption 2 Enhanced è ...
3Dfx Voodoo 2, una GPU nata con la scade...
Apple Watch: la Mela dovrà versar...
TIM e Nokia insieme per potenziare il 5G...
Musk lancia la nuova era dei DM su X con...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 03:25.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Served by www3v