Detaching files uploaded to server via web browser and File Upload

Yesterday, I posted this…

http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/0a57dd2311421bc585256e09001faa07?OpenDocument

However, I’m seeing that the problem is bigger than just what I have described above. I still don’t have a clue how to deal with the problem.

I’m going to first describe what I have, then, what I need!

I have a form with a few fields on it. When I look at the info box, I see these fields

$$Return, Data Type: Text

$FILE, Data Type: Attached Object

$UpdatedBy, Data Type: Text List

$V2AttachmentOptions, Data Type: Text contents “0”

DbName, Data Type: Text, Formula: @WebDbName

FileName, Data Type: Text, Formula: @AttachmentNames

Form, Data Type: Text, Contents: “MyFormName”

In addition, I have a File Upload Control so that web users can attach a file.

What I need is the following:

  1. From WebQuerySave I call an agent that should detach the file,

  2. then I want to read the detached .csv file, and create documents with the data from the csv.

  3. I need to delete the file from the server OS.

I’m doing this in Java, and I have much of the processing code written. This works. Needless to say, the code has become quite involved.

Here are my questions.

  1. Because I don’t have an RTF on the page where we “hold” the file, how can I detach the file?

  2. I’ve tried a few of the snippets of Java Code that allow me to determine what kind of embedded object it is, however, it looks like I (again) have to access it through an RTF object. Any other Ideas how I could code this?

  3. Would there be an easier way for users to send me their files? Some of these files will get quite large. Email is out of question.

Help!

Marcus

Subject: detaching files uploaded to server via web browser and File Upload

Is this code/situation to be processed at the server level?

If you have this code to be run at the server level, have you thought about straight LotusScript? You can do all what you want without much code too.

I don’t want to do change but you can detach files, delete the file from the server os, and make lotus notes records from LotusScript. I use it on a lot of my websites without a problem.

HTH – Cheers

Subject: RE: detaching files uploaded to server via web browser and File Upload

Thanks for the encouragement Joe…

Do you have a code sample that works?

Remember, I’m not putting the file into an RTF. It’s going into $File on it’s own.

Subject: detaching files uploaded to server via web browser and File Upload

I have been using the following for quite some time to extract files from email messages where the file name is included in the subject.The curDoc is the email document and should work for another type of document.

public void extractFile()

{

try

{

        String subj = curDoc.getItemValueString("Subject");

	int sp = subj.lastIndexOf(' ');

	subj = subj.substring(sp + 1);

	EmbeddedObject file = curDoc.getAttachment(subj);

	

	salesFileName = "Sales" + getNextFileNumber();

			file.extractFile(salesFileLocation + salesFileName);

	

	

	// file is now saved at  salesFileLocation\salesFileName

	

}

catch(NotesException e)....