Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-04-19 14:43:19

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

I´m currently facing some permission problems. The script tries to create the “upload” directory beneath the “textpattern” directory. Then it tries to create the files FancyUpload requires.

Problem is this: On my webhost, this works out fine. But I found out that on some other hosts, the creation of this folder fails due to the lack of permissions. So, just chmod your textpattern to 0777, then install the plugin. Check the “content/images” tab to see whether it worked out.

If so, set permissions of /textpattern/ back to 0755.

Could an expert help me out, please? On Linux systems, files/folders created by PHP have a different permission user/group than they would have if you upload them via FTP. Thus, manual deletion of the files fails. How to avoid this without foregoing the PHP file creation? I know it would work out if people just upload the folder. But I would feel sorry for the lack of comfort ;)

Last edited by grundgesetz (2009-04-19 14:45:53)

Offline

#14 2009-04-19 14:54:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: jbx_multiple_image_upload

grundgesetz wrote:

The script tries to create the “upload” directory beneath the “textpattern” directory.

Forgive the naive question: couldn’t you create the ‘upload’ directory beneath the ‘images’ directory? That has to have write permission in order for Textpatten to work correctly.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2009-04-19 15:33:44

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

I feel quite ashamed now… thanks for that! :)
-> directory will be located at /images/upload/ in the next version

I really have to revise the code from ground up after my final exams. Getting into this slowly…

Last edited by grundgesetz (2009-04-19 15:42:26)

Offline

#16 2009-04-20 01:07:19

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

Hey Folks…

I had some spare time, so i completely revised the code.

jbx_multiple_image_upload v0.3a

  • Bloke: changed directory to images/upload
  • jm: used a class now. nearly no globals, no constants, please have a short expert-look into it ;) I tried to make it PHP4-compatible.

What do you say?

Last edited by grundgesetz (2009-04-20 01:08:29)

Offline

#17 2009-04-20 01:25:04

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jbx_multiple_image_upload

grundgesetz wrote:

What do you say?

I say hooray! Very nice. I assume there’s a five file limit…

Offline

#18 2009-04-20 01:31:56

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

mrdale wrote:

I say hooray! Very nice. I assume there’s a five file limit…

Oh :D Didn´t mind that. -> now is 100. Don´t know about perfomance at that numbers though…

Last edited by grundgesetz (2009-04-20 01:32:07)

Offline

#19 2009-04-20 01:56:56

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jbx_multiple_image_upload

Yeah, maybe add the file limit to the admin tab. Other than that, this is mucho cool.

Offline

#20 2009-04-20 02:15:08

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

Okay I will add that as an option. How about file size limit?

Note: Image Uploads are not restricted by this value. The maximum allowed size for images is always ~ 1MB (unless restricted by PHP as explained above).

What does that mean? Is the only restriction the php.ini?

Offline

#21 2009-04-20 02:17:47

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jbx_multiple_image_upload

Not as concerned about this file size limitation. Any image that I upload for front-side display is going to be WAY smaller than that, otherwise I upload it as a file for download rather than display.

Offline

#22 2009-04-20 02:34:45

grundgesetz
Plugin Author
From: Germany
Registered: 2009-04-17
Posts: 24

Re: jbx_multiple_image_upload

Files Limit is implemented now.

Offline

#23 2009-04-20 10:49:24

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: jbx_multiple_image_upload

This is useful, thanks!
The only issue is the plugin is working ok on a live site but won’t work in my local xampp installation.
I got a flashing warning when I try to upload which complains about the “move_uploaded_file” function in line 37 of upscript_0.3a.php.
Maybe it has to do with the presence of forward/backward slashes in windows?
Another little thing: the warnings are flashing for a second so it’s impossible to read them (I had to hit the “print” key and see the screenshot in another program). maybe it would be better if they remained on the screen.
Other than that it looks really promising, thanks again.

Offline

#24 2009-04-20 15:38:48

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: jbx_multiple_image_upload

Great work grundgesetz :). Something you might want to consider:

  1. Use TXP core’s DS constant instead / (slash) when uploading images (in every dir/file path, you could for example replace the slahesh with DS etc in some situations). The DS constant automatically changes the slash depending on the system. Currently the plugin only works on unix systems that use / and not \.
  2. Maybe put doSlash()es at the end of strings, after you have textiled or cleared it. Escaping might cause some trouble. For example $catname on line 419.
  3. On line 82 (and so on). you use "http://".$prefs['siteurl']."/". You could just use hu that builds the full address, and doesn’t force the usage of http instead of https.

Last edited by Gocom (2009-04-20 15:43:42)

Offline

Board footer

Powered by FluxBB