Copy file via command line

pilot830

New Member
YetiShare User
Jan 22, 2014
242
1
0
Anyone know of any simple php code that i could use to copy a file to a new shorturl ? via command line ?
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
There is a copy function on the file manager that do this. With php you can duplicate the row directly in the database with a different shorturl.
 

pilot830

New Member
YetiShare User
Jan 22, 2014
242
1
0
enricodias4654 said:
There is a copy function on the file manager that do this. With php you can duplicate the row directly in the database with a different shorturl.
can you point me in the right direction? What file would this function be located in?
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
pilot830 said:
enricodias4654 said:
There is a copy function on the file manager that do this. With php you can duplicate the row directly in the database with a different shorturl.
can you point me in the right direction? What file would this function be located in?
account_copy_file.php in the /core/page I guess.
 

pilot830

New Member
YetiShare User
Jan 22, 2014
242
1
0
enricodias4654 said:
pilot830 said:
enricodias4654 said:
There is a copy function on the file manager that do this. With php you can duplicate the row directly in the database with a different shorturl.
can you point me in the right direction? What file would this function be located in?
account_copy_file.php in the /core/page I guess.
Yea, I figured as much, but still not sure how to use it. I opened a ticket asking but haven't heard back yet

I see it says
// attempt to copy the file
$newFile = $file->duplicateFile();

trying to figure out how to use it..

like, as a starting point, i tried to do <?php echo $file; ?> on a video page, to see what $file says.. but didn't see anything

i thought if i can figure out what $file is, then i could try to do

<?php

duplicateFile(SOMETHINGHERE);

?>

i tried putting a shorturl in the brackets, didnt seem to work

or i tried in a new file

<?php
/* setup includes */
require_once('../../core/includes/master.inc.php');

$url = 'ashorturlhere';

$newFile = $url->duplicateFile();

when i went to that php page in my browser, it said

SYSTEM ERROR

Call to a member function duplicateFile() on a non-object
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
pilot830 said:
Yea, I figured as much, but still not sure how to use it. I opened a ticket asking but haven't heard back yet

I see it says
// attempt to copy the file
$newFile = $file->duplicateFile();

trying to figure out how to use it..

like, as a starting point, i tried to do <?php echo $file; ?> on a video page, to see what $file says.. but didn't see anything

i thought if i can figure out what $file is, then i could try to do

<?php

duplicateFile(SOMETHINGHERE);

?>

i tried putting a shorturl in the brackets, didnt seem to work

or i tried in a new file

<?php
/* setup includes */
require_once('../../core/includes/master.inc.php');

$url = 'ashorturlhere';

$newFile = $url->duplicateFile();

when i went to that php page in my browser, it said

SYSTEM ERROR

Call to a member function duplicateFile() on a non-object
I seems that you don't know the basics of php. I recommend hiring a freelancer to do the job.