Hi,
Is it possible to upload avatar (<512Kb) with sfs2x ? Now I have another webservice to handle avatar upload but it will be great if I can use sfs only (with port 9933)
Thanks
avatar upload with sfs2x
Re: avatar upload with sfs2x
Yes, you can send byte arrays with the protocol so in essence you can transfer any file
See the SFSObject putByteArray method:
See the SFSObject putByteArray method:
Code: Select all
SFSObject.putByteArray("avatarImage", byteData);
Re: avatar upload with sfs2x
Hi Lapo,
Thank for your response. But I wonder this is safe or not, since with http file upload, the file data is stored on disk so it will prevent out of memory. With your suggestion, if 1000 users upload a 512Kb avatar then it will cost alot of memory.
Thanks,
Nghia
Thank for your response. But I wonder this is safe or not, since with http file upload, the file data is stored on disk so it will prevent out of memory. With your suggestion, if 1000 users upload a 512Kb avatar then it will cost alot of memory.
Thanks,
Nghia
Re: avatar upload with sfs2x
I wasn't implying that the data should be kept in memory.
Once the server side Extension receives the bytes of an avatar it should store it on disk, or database.
Once the server side Extension receives the bytes of an avatar it should store it on disk, or database.
Re: avatar upload with sfs2x
Hi Lapo,
As server side extension received the byte[], so I think the avatar data is kept in memory when server side code handles it
Code: Select all
SFSObject.putByteArray("avatarImage", byteData);
As server side extension received the byte[], so I think the avatar data is kept in memory when server side code handles it
Re: avatar upload with sfs2x
Well, not for long actually
Once you leave the handleClientRequest method the data is gone. So it's up to the developer to decide what to do while the data is in his hands, typically I would store it somewhere for later use.
Once you leave the handleClientRequest method the data is gone. So it's up to the developer to decide what to do while the data is in his hands, typically I would store it somewhere for later use.
Who is online
Users browsing this forum: No registered users and 78 guests