Hi - I have spent all weekend and quite a few evenings on a problem. Im building a website and i want a more advanced way of uploading images than the built in upload control in Domino.
Im using something called MultiPowUpload 2.0 which is a client based tool that simply uploads a file to an url i can specify - in my case a java agent on my webserver. From the agent i can access the uploaded file with:
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Document doc = agentContext.getDocumentContext();
// the rest of my code
} catch(Exception e) {}
}
}
The uploaded file is a jpg file at 48KB and in the document the length of the REQUEST_CONTENT item is 51KB, so in my mind i just need to decode the data in that item - and my best bet is to do that with:
FileOutputStream fileOut = null;
try {
fileOut = new FileOutputStream(content);
} catch(Exception e) {}
if (fileOut != null) {
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush();
fileOut.close();
}
where content is the data in the REQUEST_CONTENT item.
And now the problems begin.
When i try to read the content of the REQUEST_CONTENT item it only get like 4-5KB of the 51KB that the item holds. I have tried everything i know to get all the data but it is like the script doesnt recognize that there are more data than the 4-5KB.
I dont know what to do from here - if you could help me it would solve a huge problem for me. ![]()
Even if your solution means taking another approach then using MultiPowUpload.
Jacob Hansen