BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links


BlackBerryApps.com Best Sellers



Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
somashekar Offline
Knows Where the Search Button Is
 
Posts: 19
Join Date: Sep 2009
Model: 9530
PIN: N/A
Carrier: soft
Default Attaching file for E-mail - 09-22-2009, 02:57 AM

Hi All,

I need to attach a file to send a mail. i am not finding how to open the file browser form the composer...

Please let me is there any way...

Thanks in advance..

Soma
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
Kevin Boyd Offline
New Member
 
Posts: 14
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Default 09-22-2009, 04:47 PM

The code I posted to your previous thread already does attachments.

http://www.blackberryforums.com/deve...simulator.html

Last edited by Kevin Boyd : 09-22-2009 at 04:51 PM.
   
Reply With Quote
  (#3 (permalink)) Old
Raja86 Offline
New Member
 
Posts: 5
Join Date: Sep 2009
Model: 9500
PIN: N/A
Carrier: T-mobile
Default 09-23-2009, 01:17 AM

Kevin code is working

Last edited by Raja86 : 09-23-2009 at 01:31 AM.
   
Reply With Quote
  (#4 (permalink)) Old
somashekar Offline
Knows Where the Search Button Is
 
Posts: 19
Join Date: Sep 2009
Model: 9530
PIN: N/A
Carrier: soft
Default 09-23-2009, 01:39 AM

Kevin that code is working fine i was giving the full path for the file name..

i want to select a file using a file browser.. like we do in normal file attachments...

so please help me in this case..

to open a file browser and get the selected file path....


thanks in advance
   
Reply With Quote
  (#5 (permalink)) Old
Kevin Boyd Offline
New Member
 
Posts: 14
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Default 09-23-2009, 05:09 PM

I think you will have to write your own class to do the file browsing. Here is some code to get you started.

Code:
// return comma seperated list of folders or files
public String ListFoldersOrFiles(String srcdir, boolean getFolders)
{
	String names = "";
	try 
	{
		FileConnection fconn = (FileConnection)Connector.open(srcdir);
		Enumeration currentRootEnum = fconn.list("*", true);
		while (currentRootEnum.hasMoreElements()) 
		{
			String name = currentRootEnum.nextElement().toString();
			fconn = (FileConnection)Connector.open(srcdir + name);
			if (getFolders && fconn.isDirectory())
				names += name + ",";
			else if (! getFolders && ! fconn.isDirectory())
				names += name + ",";
		}
		fconn.close();
		return names;
	} 
	catch (IOException ioe) 
	{
		return names;
	}
}
There is also a fileexplorerdemo in the JDE sample code.

Last edited by Kevin Boyd : 09-23-2009 at 05:15 PM.
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2009 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.