Project

General

Profile

Actions

Task #96780

closed

rename file in server

Added by razieh zivaralam almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-02-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
pending-close
Complexity:
Sprint Focus:

Description

hi evreybody
how can i rename a file in server? I wanted to change an uploaded file with another file... i changed the contet of the old one into new file with below code:

$fileReference = $this->resourceFactory->getFileReferenceObject( $id);
$file=$fileReference->getOriginalFile();
$file->setContents($content);

i see the new file now in frontend but i want to change the name of file too? how can i do it?

i dont wanted to delete the file and add a new file beacuse i dont want to increase id in sys-table and etc.....

Actions

Also available in: Atom PDF