That would be cool for those who have files stored else where that would like to use the counter...
I like the snippet how it’s meant to work... works great.
Ross
-
- 138 Posts
I’m just curious about something (not directly related to the snippet). What does the "self::" bring compared to "this->" ?
-
- 925 Posts
This requires to set up each download individually, right (unlike FileDownload, which grabs all of the files in a folder)?
-
- 332 Posts
I followed every step, but when I tried to upload a file, it gives me this error:
Error, "Failed to upload file, internal error..."
What would be the possible cause? The file upload browser is FCKEditor, I don’t have it installed, and had turned the tinyMCE off. Does this matter?
Thanks!
-
- 332 Posts
Hi Scotty, thanks for the suggestions.
Under Media Temple’s server
resource path : Checked - it was default (serverpath/assets/)
Permission was 755, but I changed it to 777.
"file_uploads’ is on.
In the Resource browser, it says I have no permission to create folder, but I am logged in as admin.
I FTP a few files in the folder, when I check that page, I see a ’0’, so I guess your snippet is working but something is wrong with system or config? My modx version is the latest, just upgraded it yesterday.
I tried the snippet on client’s hostgator server
I am able to create folder, when I tried uploading (PDF and JPG), it shows this error: Disallowed File Type
-
- 315 Posts
Another great snippet Scotty.
I use FileDownload with the plugin quite a lot and I like it but for two slight technicalities: You can’t download and browse at the same time and the counter goes up if the download is cancelled before completion.
How does your counter.. well... er count and can you still browse the site if you are downloading?
Thanks and S! again. I’m sure this will be as popular as webloginpe.
BBloke
-
- 1,193 Posts
Hey BBloke.
You should be able to continue browsing, but I have never run into that problem before, so test it for me and let me know.
The download is counted when the file is requested and the file transfer is initiated. If the user cancels, there is no signal sent back to the browser that could be acted upon to undo the counter increment. Sorry.
-sD-
Dr. Scotty Delicious, DFPA.
-
- 315 Posts
Hi Scotty,
After diving in I hit a bit of a stumbling block. Not through your snippet but how I’ve been using an alternative. I love the condensed nature of your code and its simplicity. What I have at the moment is a website that uses FileDownload and plugin where I can use the same code across many pages within a specific range of documents. This is excellent as it allows a beginner to create a page via "add a blog" and the addition of the default comments chunk at the end maintains the ability to access individual or multiple files for downloading depending on the given TV folder variable. Unless I’m missing something then I would need a unique page per modx page in order to link to a download. Thats twice as much work. I’m hoping and pretty sure I have this wrong as its late and I lacking a heap of sleep.
I guess I’m looking for my own ideal way close to what I have already minus the limitations.
S! and thank Scotty
BBloke