Newbie : Upload file to database Method
Newbie : Upload file to database Method
- Subject: Newbie : Upload file to database Method
- From: Gilles MATHURIN <email@hidden>
- Date: Wed, 27 Sep 2006 21:20:10 -0400
Hello list
i look at the Developper example application who demonstrates the
creation and use of WOFileUpload elements. It says that this element
allows you to transport files from client machines to your
application server. My question is :
Does that mean either "transport" to the database for storing ? Or
only transport to the application for logic treatment ?
I don't know if i am clear, so let me reformulate : Are these
examples adapted in the case you want to upload file to your database ?
I write a WOwebapp to administrate a database, when i test it on my
dev machine and on my local network, it works great, but will it work
on the final deployment configuration, when the hosted server will be
far away ?
Here is an example of code used in it to upload images or mp3.file to
the database :
===============
public WOComponent recordNewTitre()
{
EOEditingContext ec = album.editingContext();
extraitForm.setExtraitMp3(aFileMp3);
extraitForm.setFileName(aFileNameMp3);
extraitForm.setMimeType(aMimeSoundType);
album.addObjectToBothSidesOfRelationshipWithKey(titreForm,"titres");
titreForm.addObjectToBothSidesOfRelationshipWithKey
(extraitForm,"extraitTitre");
ec.saveChanges();
setTitreList(album.titres().mutableClone());
setBoolTableauList(true);
return null;
}
public NSData aFileMp3()
{
return aFileMp3;
}
public void setAFileMp3(NSData newAFileMp3)
{
aFileMp3 = newAFileMp3;
}
public String aFileNameMp3()
{
return aFileNameMp3;
}
public void setAFileNameMp3(String newAFileNameMp3)
{
aFileNameMp3 = newAFileNameMp3;
}
public String aMimeSoundType()
{
return aMimeSoundType;
}
public void setAMimeSoundType(String newAMimeSoundType)
{
aMimeSoundType = newAMimeSoundType;
}
====================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden