Or is there any possibility to pass the cid value directly on the sandbox?
First, there is nothing to do with the sandboxes. You are currently coding inside your component.
Well, I give you the answer :
TODO :
controllers/{mycontroller}.php :
function save() AND function apply() :
//UPLOAD FILE : My File
if (!$this->_upload('my_file', &$post, array(
'image/jpeg' => 'jpg,jpeg')
, array(
'overwrite' => 'yes',
'rename' => '{BASE}.{EXT}', // <- HERE
)))
return;
replace with :
'rename' => (int) $cid[0] . '_{BASE}.{EXT}',
But you can change the patterns as you want ({BASE}, {ALIAS}, {EXT}, {BASEXT}, {RAND} ...
That solves ?
EDIT : I see you tried to add a {CID} pattern, wich is a nice idea, you can do it also...
So you can rewrite in the class file.
Add this code in the renameFile() function
//Cid when available
$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
if (count($cid))
$this->parsePattern($pattern, "CID", (int)$cid[0]);
Not tested, but sould work.