
Tag(s)
Drupal - Updating File name
If you know the file id, it is really simple,
Code:
$file = file_load($fid); file_move($file, 'public://new_file_name);
How it works:
If you know the file id, it is really simple,
Code:
$file = file_load($fid); file_move($file, 'public://new_file_name);
How it works:
'A picture is worth a thousand words', a famous adage. Images plays an important role in elaborating the contents. But at times there may transpire a situation where these images has to be saved from a remote site and then upload them into the corresponding content. If the images reaches a out bound limit, it becomes infeasible to have a endeavour. At such a instance the best approach is to programmatically save the images in your local system.