BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-22-2009, 01:57 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: 9530
PIN: N/A
Carrier: soft
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Attaching file for E-mail

Please Login to Remove!

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
Offline  
Old 09-22-2009, 03:47 PM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

sending mail from BB simulator

Last edited by Kevin Boyd : 09-22-2009 at 03:51 PM.
Offline  
Old 09-23-2009, 12:17 AM   #3 (permalink)
New Member
 
Join Date: Sep 2009
Model: 9500
PIN: N/A
Carrier: T-mobile
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Kevin code is working

Last edited by Raja86 : 09-23-2009 at 12:31 AM.
Offline  
Old 09-23-2009, 12:39 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: 9530
PIN: N/A
Carrier: soft
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Offline  
Old 09-23-2009, 04:09 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2007
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 04:15 PM.
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.