NealC
Well-known member
For example, if /resources is in the URL, don't use presigned?
It doesn't work that way.Can XF get you a demo to dev against?
If you are doing attachments "normally", the content type is set by XenForo.Strike that, it's not area specific. I went back to old posts with various attachments and see the issue there. Who really controls the content type, the requester or the host? For example, if you're going to request a file that ends in .PDF, shouldn't the caller by specifying the content type? If you know the extension of what you're calling can't you specify the content type? Thinking out loud....how can we resolve this?
I don't use rclone myself, but I vaguely recall seeing somewhere it uses the mime-type definitions for the system you are running rclone on. The better thing to do is just not set the content type though (which is why things work better that were uploaded by the addon... new stuff).Thank you. I used that tool, discussed on this site or in your add-on description (can't remember) that mass uploads the files to R2. I don't recall an option to pass a content type and I guess the .data being generic R2 just put application/octet-stream on those. Not sure exactly how to fix but I'm not sure presigned URL's offer me that much savings to warrant this effort? I don't know... The question remains, how can this work when presigned URL's are OFF and the issue is only affected when ON?
/etc/mime.types
file. ".data" isn't a normal mime-type in there (I just checked my servers and it's not in there with a fairly vanilla/default file) , so I suspect someone on @NealC's server set .data to some specific mime type there, and then rclone decided to adopt that since that's what someone set it to system-wide.There certainly could be data that Cloudflare can't identify, but it never identifies based on object key (the part that looks like a path/filename/extension). You could certainly have a raw binary file of random bits and it wouldn't be able to identify it. But if it's something standard (image, PDF, zip file, video, audio, etc.) it will identify it.I don't believe .data is the mime type, it's the file extension set by who knows. R2 couldn't identify .data so it went to application/octet-stream is my guess as a safe fallback.
.jpg
, but Cloudflare correctly assigned the right content type because it only looks at the actual content (not the key). XenForo saves all avatars with .jpg extension even if they are PNG (or other formats), so it's a good demo of Cloudflare only looking at the content (and never the key/"filename").image/jpeg
content types even if some are PNG or GIF. The good news for that is it's fairly common for images to get assigned the wrong extension on websites, so I suspect that for images, browsers will treat the image as the content it is rather than what it's told by the web server.php cmd.php dp:migrate-data --help
php cmd.php dp:migrate-data --new-to-old --processes=20
--new-to-old
flag (then it will take the stuff in the local filesystem to R2).If that were the case, wouldn't PNG images with .jpg extensions then be assigned anI believe that by default, rclone will attempt to override content type/mime type if the machine (server) running it has system-wide mime types for certain extensions. On Linux, that would be in the/etc/mime.types
file. ".data" isn't a normal mime-type in there (I just checked my servers and it's not in there with a fairly vanilla/default file) , so I suspect someone on @NealC's server set .data to some specific mime type there, and then rclone decided to adopt that since that's what someone set it to system-wide.
image/jpg
mime type?/etc/mime.types
don't even show a .data
extension, although that was via a cursory glance at it so far.I’ve never personally used rclone, so can’t really answer any of it. I only know what I Google (which definitely could be wrong).If that were the case, wouldn't PNG images with .jpg extensions then be assigned animage/jpg
mime type?
As I mentioned, everything worked properly when I used rclone, so I don't know if it would affect the mime type at all. My/etc/mime.types
don't even show a.data
extension, although that was via a cursory glance at it so far.
Rhetorical question, but why would rclone do anything to alter a mime type? Its function is to copy a file from one place to another. (Not that I'm an expert on it, but...)
ErrorException: [E_WARNING] Undefined array key "value" in src/addons/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php at line 231
- XF::handlePhpError() in src/addons/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php at line 231
- DigitalPoint\Cloudflare\Admin\Controller\Cloudflare->actionToggle() in src/XF/Mvc/Dispatcher.php at line 352
- XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
- XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
- XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
- XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2487
- XF\App->run() in src/XF.php at line 524
- XF::runApp() in admin.php at line 13
Is it when trying to change a specific setting, or is it anything? Also, are you on a free or paid plan for the zone?I just installed this add-on on a new site (fresh install, no posts, no other add-ons) and when I try to change a setting on the settings page, I get this error:
Might be worth noting that the API token is all added and I can add cache/page rules (haven't tested anything else), but I'm not able to change anything on the main settings page without getting that error.
We use essential cookies to make this site work, and optional cookies to enhance your experience.