Jump to content

Search the Community

Showing results for 'files'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. I’ve been working on a module to store ProcessWire files directly on Backblaze B2, and wanted to share it with the community. Why I Built This I needed to host video content without breaking the bank on storage costs. AWS S3 was too expensive, and I wanted something that integrates seamlessly with ProcessWire’s existing file fields. Key Features 🚀 Direct B2 Upload - Files go straight to Backblaze, no local storage needed 💰 Dirt Cheap - $6/TB/month (AWS S3 costs 5x more) 🌐 Custom Domain Support - Use your own CDN domain ⚡ Cloudflare Integration - Combine with Cloudflare for FREE bandwidth 📦 Works with Repeaters - Multiple files per repeater item 🎬 Perfect for Video - Tested with Plyr, Video.js, and HTML5 video Real Cost Savings Here’s what I’m actually paying for 500GB of video storage: Backblaze B2 + Cloudflare: - Storage: $3/month - Bandwidth: $0 (free via Cloudflare Bandwidth Alliance) - Total: $3/month AWS S3 (same usage): - Storage: $11.50/month - Bandwidth: $450/month (5TB) - Total: $461.50/month That’s a 99% savings on bandwidth costs! How It Works The module extends ProcessWire’s file fields to upload directly to Backblaze B2. You can use it just like regular file fields: // Single video <video controls> <source src="<?= $page->b2_video->url ?>" type="video/mp4"> </video> // Multiple videos in repeater <?php foreach($page->videos as $item): ?> <?php foreach($item->b2_video as $video): ?> <video controls> <source src="<?= $video->b2url ?>" type="video/mp4"> </video> <?php endforeach; ?> <?php endforeach; ?> Cloudflare CDN Integration Want free bandwidth? Here’s the magic setup: CNAME: cdn.yourdomain.com → f005.backblazeb2.com (with Cloudflare proxy) Transform Rule: Rewrite paths to include /file/bucket-name/ Module setting: Enable custom domain Now all files serve through Cloudflare’s global CDN with zero bandwidth costs thanks to the Bandwidth Alliance partnership. Setup is Simple Create Backblaze B2 bucket Configure module with API keys Create field (type: FieldtypeFileB2) Add field to template Upload files - they go straight to B2! Optional: Add Cloudflare for free bandwidth and caching. Use Cases Video hosting (my use case) Large image galleries Audio files / podcasts Downloadable resources Any high-bandwidth file hosting Technical Details Works with public and private buckets Supports custom Cache-Control headers Files are deleted from local server after upload Can use custom domains via Cloudflare CORS configurable for cross-domain access Try It Out GitHub: https://github.com/mxmsmnv/FieldtypeFileB2
      • 11
      • Like
      • Thanks
  2. @cb2004 Probably just regular markup regions would handle that just fine. Unless I misunderstand, I don't think you'd need file regions for that. Where file regions would be helpful is if you wanted to keep all that repeater matrix output code self contained, perhaps in your repeater matrix template file. Like if you had certain CSS and/or JS that was just for that repeater matrix stuff, you might find it easier to build and maintain longer term if the output code is all kept together, rather than spread across different files. That's one thing I find file regions particularly helpful for so far.
  3. @ryan looks amazing to me. I use region("gallery", true) or similar in repeater matrix files and then do some logic in _main.php currently. Guessing this could replace that, or do markup regions not look that deep within repeater matrix template files?
  4. This week I've added support for File Regions, part of the Markup Regions output system in ProcessWire. File Regions enable you to populate CSS and JS files with Markup Regions. I'm short on time today, so rather than writing much about it here, I've put up a documentation page for it in the API reference, which I'll link below. I'm using File Regions on a project right now and am finding it to very useful. Especially on a project where there are multiple developers, it simplifies a lot to be able to build features as self contained components, while still using the traditional route for site-wide stuff. It's something different, and I'm curious to know what you think. Here's the new documentation page for File Regions below. The page was a bit rushed, so I'll likely be amending it, but hopefully it gets across the main ideas. Thanks for reading and have a great weekend! https://processwire.com/api/ref/wire-markup-file-regions/
  5. @DrQuincy, responding to the title of the topic: PW allows for access control at the field level as well as the template level. I don't think you need to do anything special with repeaters or child pages to achieve what you're describing. In your template settings: Do you want to manage view and edit access for pages using this template? > Yes Allow view access for "guest", seeing as you generally want the page to be viewable by everyone. Prevent direct access to file assets owned by pages using this template? > Yes always, regardless of page status or access control In the fields listing for the template, click to edit the files field in template context. Enable access control for the field and remove view access for "guest" (and any other roles who are not allowed to view the files). Now guest users will be able to view the page, but not access the files.
  6. Interesting. I tend to handle Repeater Matrix items with /site/templates/fields/ files, so not sure if I've actually attempted this 🙂 If you're doing this in the context of another page, one option might be using Wireframe::page(). I seem to recall having used it for rendering Repeaters. Though not sure if that's exactly what you're looking for here?
  7. This week I’ve been working on some useful additions to our Markup Regions system, but I don’t have those additions quite ready to commit to the core just yet. Hopefully next week they will be ready. What it involves is the ability to populate regions within CSS, JS, SCSS, LESS files. So I might output a <style> tag in my markup (for example), but the styles go into a CSS file rather than in the HTML output. That CSS file combines and contains all such instances, and can then be loaded from a dedicated <link> tag in the document head. You could do the same with JS, but using <script> tags instead. I’m not sure I’ve explained it well just yet, so I’ll have a better description of it next week, along with some practical examples. It’s very simple and I think examples will make it obvious. Stay tuned, have a great weekend and thanks for reading!
      • 18
      • Like
  8. I suspect it has to do with the new $files->unzip class method(s) (assuming it's part of dev version 253): https://github.com/processwire/processwire/commit/3f15400643a8c8eecf39b59144d94553fb876bcd I'm not yet running that version, but for those that are, if you wanted to dig down into the rabbit hole to discover where some inconsistencies might lie within the code, I'd start there.
  9. Thanks wbmnfktr, I did move the files manually and installed Tracy, resulting in a different 500 error upon trying to configure it. I suspect this to be a dev core issue rather than module issue. This is a new installation, so I can easily wipe this and start new. Edit: I also installed an old version of Tracy - or tried. Same error. And that version definitely used to work.
  10. Hi, Are we the only ones who are running into this error during Updates and Installations of TracyDebugger? It is definitely a new error. Right now I cannot verify, but I want to say that I have seen it across various hosting environments. (I just ignored it before, because they were updates. Now I am trying to create a new installation. PW: 3.0.253 Tracey: latest from Git
  11. My tailwind.dist.css file only contains what my projects need most of the time - on all pages/views/whatever. 😁 So there is that. However you could split it up in several TailwindCSS files. One for only layouts, one for components (or even each component), one for this, and one for that. It depends on how much time you want to invest and break things up into smaller pieces and then add to whereever you finally load the CSS files. I think it's quite a bit of an overhead, but in case your projects are huge or have multiple areas, such as frontend, backend (not ProcessWire itself, but like a custom member area) this could help. First step would be disabling automatic detection - see here: https://tailwindcss.com/docs/detecting-classes-in-source-files#disabling-automatic-detection Then you would need multiple .css files that have directives to source only some parts of your files. It really depends on how well-structured your files are. Also in the docs, see link above. @import "tailwindcss" source(none); @source "../admin"; @source "../shared";
  12. In a template you can enable: Prevent direct access to file assets owned by pages using this template? And in site/assets the folder of that page has a minus prefix added so Apache tells PW to handle the file request. I have a situation where I want the top level page to have no access control but I also have a series of files where I need access control. I.e. it's a mix. I'm just wondering if I make the files be part of a repeater, can I set access control for the repeater only since it has its own ID. Will this work? I would guess that it does but I wanted to see if anyone has used this approach in production.
  13. @olafgleba i'm afraid you didn't missed anything, there is no sorting options for files and/or images (same king of things) except from using your mouse 🙂 well something llike this in your ready.php file should do the trick (sorting happens when you save the page) $this->addHookAfter('FieldtypeFile::wakeupValue', function($event) { $field = $event->arguments('field'); // being a frenchie my field is called "fichiers" // change this to yours 🙂 if($field->name !== 'fichiers') return; $pa = $event->return; $pa->sort("name"); $event->return = $pa; }); have a nice day
  14. Hi @virtualgadjo, thx, yes, drag and drop is possible. I meant something like sorting the files alphabetically for example. Or by name etc. Just like you do it template based in the page tree. have a nice day too 😉
  15. Hi, not sure i really unsderstand your question but if it actually is can you sort/reorder files in the backend, the answer is yes, catching an element in the list by the bar containing its name you can move it to the position you want in the list just in case have a nice day
  16. Hi, hm, i have the faint idea i did it sometime ago, but can't remember now i am afraid: I have a page with only one field of type 'file'. Do i have the ability to change the sorting of those files within the backend view? Thx in advance, Olaf
  17. Hi @adrian, while your module is a real pleasure to work with, i wonder if i miss something, as "Copy Field Content to other Page" seems not to work with fields of type "files". The references are copied, but the files itself not. Not sure if this is intended or maybe a bug? Cheers Olaf
  18. Hi @BrendonKoz, thank you for your reply. The module files are in place and complete. To recreate the table schema - I'd not know how to do. I looked up some documentation to the return type warning and found informations on a certain #[\ReturnTypeWillChange] attribute: https://www.php.net/manual/en/class.returntypewillchange.php and https://stackoverflow.com/questions/71133749/reference-return-type-of-should-either-be-compatible-with-or-the-re Obviously these are for handling problems with an update of the PHP version - which didn't change... Should I try to use this attribute? It's said that would supress the warning but seems prone to issues in the future.
  19. Have you tried to re-add the module files, and recreate the table schema (hopefully the data wasn't necessary) to see if it would be enough to provide a state that removes the errors? The ini_set errors are likely showing simply because errors are being output to the browser prior to a header() call being made; standard issue when errors are displayed in PHP. Fixing the errors should fix the ini_set warning.
  20. I wouldn't call it extensive knowledge 😅 It was just a regular PW installation that was copied via cronjob to another vhost on the server (both files and DB).
  21. Hi when it comes to a "select" just install the select options module which is in pw by default and then when adding a new field you'll be able to choose when it comes to images, having a close look at the full article from which the image you show comes https://processwire.com/blog/posts/pw-3.0.142/ you'll see that it relies on a template you create witjh a given naming convention --- quote--- Rather than trying to come up with some new way of defining custom fields, you define the custom fields for your file/image field with a Template. Simply create a template having the name "field-[name]" (replacing "[name]" with the name of your file/image field), add fields to it, save, and that's it. It's okay to add fields that might duplicate those already on your regular page template, as the fields for files/images are properties of each file/image rather than properties of any page. ------- not only will you be able to use radio button but nearly any kind of fields you would like to associate to the image hope it helps a little 🙂 have a nice day
  22. Thanks @Robin S for taking a look - much appreciated. It seems like a random issue here even with my simplest modules. I have played around with removing those FileCompiler files and DB entries and sometimes it helps and other times not. Sometimes I literally need to remove the namespace so I can uninstall, then add it back and then I can reinstall. I am just worried about breaking the admin for users upgrading my modules. I also wonder if sometimes it matters how the module is upgraded - replacing files directly vs updating via the PW Upgrades module - perhaps it triggers a modules refresh before the module gets to load and potentially break things 🤷
  23. Hi, since i updated my local PHP to 8.4.13 (from 8.2), all PW installations are quirky. Regardless what 3.0.x.x.x PW versions. On load (Backend/Frontend): Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in [...]/wire/core/WireSessionHandler.php on line 51 Followed then by: PHP Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in [...]/app/wire/core/WireSessionHandler.php on line 51 Although it is a deprecation/warning, it has effect on the behavior within the Backend (page tree doesn't load etc.) when debug is on. I also tried to upgrade a local PW installation (v. 3.0.242) to the latest master/dev, the folders and files are created (wire, index.php etc.). But loading the backend or frontend both gives completely blank page immediately. Fortunately the rollback works. I did a search, but found not much on this topic, i am afraid. Emptied all caches, compiled files multiple times. Does anyone have a clue what to do or where to look at? Thx in advance Olaf
  24. @adrian, it might be something that only happens with particularly complex modules, because I think I've added the namespace to a bunch of my earlier modules and never struck that problem. And if I test with a dummy module... <?php class TestModule extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Test Module', 'summary' => 'Test applying namespace', 'version' => '0.1.0', 'autoload' => true, ); } public function ready() { $this->addHookAfter('AdminTheme::getExtraMarkup', $this, 'doSomething'); } protected function doSomething(HookEvent $event) { $parts = $event->return; $parts['masthead'] .= "hello"; $event->return = $parts; } } ...then I can add the namespace without issue. If I remove the namespace from a namespaced module then I get a server error, but that's not something anyone would need to do. Just a guess, but you could try removing the previously compiled module files from /site/assets/cache/FileCompiler/site/ in the upgrade() method to see if that makes a difference.
  25. Hmm... Looking to give DDEV a try. Like Jonathan, I've had a setup that primarily runs multiple hosts from the same webserver, PHP, and SQL instance(s). Although it was Docker-based, it didn't require project isolation. Because of that, I've kept my files in a Dropbox folder, using the Dropbox client, so all of my local host machine's development files are automatically backed up and (minimally) versioned (Dropbox provides some level of version history). I'm using Windows Subsystem for Linux with DDEV, which automatically creates mounts for logical drives. Moving to DDEV, I spun up a config with the PHP, MySQL versions and web-server of choice (Apache) to mimic my production server. I also set the docroot to a folder, thinking that I might be able to create a symlink (as the /mnt/c/ contains access to the host filesystem, and therefore the Dropbox files) and overwrite the DDEV-generated docroot directory with a Dropbox symlinked project folder. After the DDEV config finished, I tested the project with a simple HTML file to make sure everything was working. (It was.) I then deleted the generated htdocs folder, and created a symlink from my mounted Dropbox's project folder to "htdocs" (the name of the chosen docroot). I am getting a Forbidden error. The file permissions seem to be set to 777 however, and the group and user match that of files generated within the DDEV container manually. I looked at the provider integration example where Dropbox is mentioned as part of the project's /.ddev/providers/ YAML folder, but I'm not using archived files, nor do I really want to have to pull/push/rsync any/all changes (I'd rather they were live since I'm editing them on the host OS, which the DDEV project can see thanks to the mount). ddev config --webserver-type=apache-fpm --php-version=8.2 --project-tld=loc --database=mysql:8.0 --docroot=htdocs From the project root, the symlink I used (for the first project as a test; my Dropbox "htdocs" folder is where I test random bits of code) was: ln -s /mnt/c/Users/brendonkoz/Dropbox/development/htdocs htdocs Does anyone have any thoughts?
×
×
  • Create New...