Hai friends
I created a custom module in SugarCE6.4. In that i want to add a field in which user can able to upload an image file. need your help to do this.
Hai friends
I created a custom module in SugarCE6.4. In that i want to add a field in which user can able to upload an image file. need your help to do this.
You should create a module based on File template.
Cheers
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
Whether do you want to create a more reusable field to file upload you could develop your own fileupload field type. It will requires more development skills.
The new sugar fields types could be created under /include/SugarFields/Fields.
Rafael Queiroz Gonçalves
Advanced OMG UML Certified Professional
Sun Certified Enterprise Architect for the Java Platform
Sun Certified Programmer for the Java 2 Platform
IBM Certified Advanced Application Developer - Lotus Notes and Domino
IBM Certified Application Developer - IBM WebSphere Portlet Factory
Computer Science Mastering / UFSC - PPGCC
check this out it may help
http://www.sugarcrm.com/forums/f3/up...ord-how-77680/
pura vida!![]()
Hi gokulakannanI did it in detailview, and it works. I did in this way:
In custom/modules/yourmodule/detailviewdefs.php
And in the root of your sugarcrm, you create a file named upload.php with something like:PHP Code:'panels' => array(
'lbl_yourlabel'=>array(
array(
array(
'customCode' => '
<form action="upload.php" method="post" enctype="multipart/form-data" name="form" target="_blank">
<label for="file">File</label>
<input name="file" type="file" id="archivo" /> //this is the type file which you need
<input name="button" type="submit" id="button" value="Send" />
</form>',),
),
),
PHP Code:<?php
$uploaddir = 'docs/'; // for example, your image will be save in this directory
//////////////////////////////////////////
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
$error = $_FILES['file']['error'];
$uploaded = false;
if(isset($_POST['button']) && $error==UPLOAD_ERR_OK){
$uploaded = copy($_FILES['file']['tmp_name'], $uploadfile);
}
if($uploaded) {
echo "File uploaded";
} else {
echo "Error: ".$error;
}
?>
If you have the Pro or Ent versions of SugarCRM, they now have an image field type. Not so for the CE version.
For the CE version, try the module from eggsurplus (make sure you get v1.3) at eggsurplus solutions | Your Personal Developer - $49.95
It is simple and it works
OK man. Your code helped me to resolve my problem. Thanks for share
--------------------------------
Game Avatar HD | game avatar moi nhat
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks