I am building an extension with extbase where I need to create a pdf file inside fileadmin folder with php from a controller :
fopen("/fileadmin/pdf/anass.pdf", "w") or die('could not create file');
The permission is granted to write files ... so I think I made a mistake writing the path. Could somebody please help me?
PS: I am working on typo3 4.5
Indeed you're specifying absolute path in the filesystem and most probably there's no such path like
/fileadmin/pdf/...there.Quite safe would be using some TYPO3 constant to specify where's your app's root i.e.
PATH_site, like:it will use the path like (sample)
note, that if you should use slash before
fileadminor not is OS/server config depended, so just check if yourPATH_siteends with slash or not.