×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2007
    Location
    Poland
    Posts
    606

    HTTP uploading larde image

    Hello
    I have got the following problem
    i want to upload images using post method to the server.
    I am using HTTP example and http://wiki.forum.nokia.com/index.ph...part/form-data to do it
    There is no problem with sending files up to 300kb but if i want to upload files which are bigger i got error "Not enough memory, close some application" I have used debugger to find out where is the problem and problem is in this part of code:
    Code:
    	RFs aFs;
    	User::LeaveIfError(aFs.Connect());
    	CleanupClosePushL(aFs);
    	RFile aFile;	
    	User::LeaveIfError(aFile.Open(aFs, aFileName, EFileShareAny));
    	TInt aSize;
    	User::LeaveIfError(aFile.Size(aSize));
    	iPostDataImage = HBufC8::NewL(aSize);
    	TPtr8 aPtr = iPostDataImage->Des();
    in line:
    Code:
    iPostDataImage = HBufC8::NewL(aSize);
    if file is really big(f.e. 500kb) creating HBufC8(500000) is not good idea and thats why i got this error

    How can i in an easy way split my big file in smaller chunks which will allow me to use that http send file in parts example.

    Maybe i m doing something wrong with that code example from wiki ?

    Thanks in advance

    Nuker

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: HTTP uploading larde image

    you could maybe try increasing your heap max size.

  3. #3
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Re: HTTP uploading larde image

    Nuke , you are right HBufC8(500000) does not make sense. So Break the data in to parts ansd send a multi-part message instead of a big one.


    Refer mime type: application/octet stream , multi-part in HTTP 1.1 docs

    Regards
    Shashi Kiran G M

  4. #4
    Registered User
    Join Date
    May 2007
    Location
    Poland
    Posts
    606

    Re: HTTP uploading larde image

    Thanks guys for responses,
    I have changed maximum heap size and everything works properly

Similar Threads

  1. about uploading image and text via http post method
    By getrmb@gmail.com in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-09-20, 10:37
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. uploading image via http
    By nit28in in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-05-16, 12:19
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •