_config.php

Is it a known bug that when you publish a page with an attached image (even with the relation listed in the $owns array) that the image still says "Draft" even though it has already been published with the page

_config.php

but i know this has now been removed in SS4

dorsetdigital

There isn't a proper way to do it, since the filesystem could live anywhere

_config.php

I'm going to scan the file with antivirus as it gets uploaded

_config.php

are you saying i'll need to build the path myself by figuring out if its published or not

jkersu

Yeah usually I'd use getString or getStream / save it to a tmp file to work with the contents of a file.... For your use case, can you see what Director::getAbsFile() does? I seem to remember seeing it be mentioned before (n.b I haven't tried using it myself though)

_config.php

Thanks I tried that, i dont think its giving me the full path including .protected etc

dorsetdigital

Saving to a temporary file from the stream is the best way

👍 (1)
jkersu

Just curious cause I also have the same problem for a client, what antivirus were you using to scan uploaded files @_config.php?

_config.php

sort of trying to get a feel for how long its gonna take so i can quote a client

_config.php

I had a pen test done on the silverstripe site i built for a client and this was one of the issues

_config.php

is it easy to copy a file to a tmp file path?

dorsetdigital

Yes. The File class has methods of getStream() and getString()

dorsetdigital

Looking through the module code, I can't see anything really obvious that would cause big problems moving to CMS 4

dorsetdigital

It even has mechanisms for files which are external to the filesystem

_config.php

yeah this file thing might be the only real blocker


Show less replies
_config.php

does anyone know how i can get a file's absolute path in Silverstripe 4

_config.php

I have a question about the CSRF token for doing graphql mutations. In regular silverstripe forms the token is added as a hidden field. Where can I get the token to use for the graphql mutation?