FTP Takeover (?) - Upload Folder & its contents

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

FTP Takeover (?) - Upload Folder & its contents

Post by jsw_nz »

As far as I know phpWcms does not support the ability to upload
an entire directory
- only the files themselves - which are then
mapped to a 'virtual' directory....

I have a need to upload an entire folder that contains image files
(the image files are created by Zoomify
- a Flash component that offers the ability to
view - zoom - pan a given image)

Apart from doing this manually (uploading folder) using standard ftp
- does anybody have an idea how the this might be done
- guessing its complicated
- but any ideas appreciated.....

:)

http://www.zoomify.com/
User avatar
metti
Posts: 81
Joined: Tue 28. Nov 2006, 07:34
Location: Merseburg
Contact:

Post by metti »

"Long time" ago i wrote a Module, thats called UploadFX (http://www.phpwcms.de/forum/viewtopic.php?t=13778).
With this you can upload multiple files.

I only tested it for 1.2.8 an don't know if it still works for newer releases.
#GeorgeWBush { position:absolute; bottom:-6ft; }
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

Hi metti,

as a crack you are, ever thought about to publish your mod development under:

http://www.phpwcms.de/forum/viewforum.php?f=18
http://www.phpwcms.de/forum/viewforum.php?f=19

???



btw:
pclZIP by Vincent Blavet seems not to work with me/my hoster/browser. :?: :shock:

What about a web based un- .zip .gz .tar ...and so on developed by you BUT independent of any phpwcms installation (--> stand alone --> NO module)???!!!

to be able to unzip, untar... archives to directories on web servers INSTEAD of ftp-uploading extracted archives???

greetz
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

How could I have missed that. BIG thanks - will give it a spin Metti
wow
:)
Jensensen's right.
User avatar
metti
Posts: 81
Joined: Tue 28. Nov 2006, 07:34
Location: Merseburg
Contact:

Post by metti »

Hi guys.

Yes of course i could do this, but as fare as i know this module is a bit bugy and there is one serious problem:

In detail it deals with fileupload into the phpwcms-filestorage and does this independent from the core. I don't like this, because this may contain security-riscs and is not safe for phpwcms-Updates.

And i was a bit disappointed because of a stupid bug in adobe flash player (There is missing a semikolon in the upload-header, so that the apache-securityMod does block the request) :evil:
I needed that much time to write the ActionScript and then a adobe-bug destroyed my work. But the Javauploader should work.

But if you wan't i will try to change the mod. What do you think is it better to write it in the new way (plug-in like)?
Hope i won't work alone on this.

(I wrote the unzip-module but i did not use it until now)

I will look a bit through the code now :shock:

@jsw_nz: did you test the module and did it work?

Bye :)
#GeorgeWBush { position:absolute; bottom:-6ft; }
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

metti wrote:...But if you wan't i will try to change the mod...
YES

but
metti wrote:...What do you think is it better to write it in the new way (plug-in like)?
for me, --> STAND ALONE suits best.
Would be best for all people, who have NO SHELL access and want to un- zip*tar*gz uploaded file archives right to a directory on the sever [instead locally first and to upload the unzipped files as a whole]

By this way, I guess, there's even no need for a module!?

metti wrote:...Hope i won't work alone on this...
Don't forget about the great community here!!!

Greetz
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
metti
Posts: 81
Joined: Tue 28. Nov 2006, 07:34
Location: Merseburg
Contact:

Post by metti »

Okay,

Thats the plan: A module for phpwcms with a standalone-JAVA-Uploader in an i-frame, that uploads files to ftp_takeover-folder and unpacks zips there.

The module will be something like a filemanager with a few more functions then the phpwcms-native (delete and edit complete folders and theyr files with one click).

Puh! Will be a lot of work and will take some time (It's realy not simple).

cheers
#GeorgeWBush { position:absolute; bottom:-6ft; }
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

Hi metti,

don't know, if I understand you right at all!? I think, the solution
metti wrote:...that uploads files to ftp_takeover-folder and unpacks zips there....
seems to be less flexible. It could be useful, if you have to upload images, that are compressed to archives. This rather seldom is the case.

So, to use one php-script-package that handles decompression to a [any] directory would be less work (for you, perhaps) but gives more comfort --> independent of fixed dir structures/module instructions/databases/ and at least phpwcms.

E.g. if images are unzipped to the ftp_takeover_Upload_dir, the file manager will do the rest...
metti wrote:...The module will be something like a filemanager with a few more functions then the phpwcms-native (delete and edit complete folders and theyr files with one click).
No need for a file manager within a file manager.
(although this --> CORE features would be nice to have!!!)

but ATTENTION: just renaming, overwriting existing files by the file manager leads to serious mistakes --> great bug!!! [as I mentioned several times in this forum]. In this case all entries in the databsae are smashed up!!!!

metti wrote:...Puh! Will be a lot of work and will take some time (It's realy not simple).
DON'T bother. Advantageous for you would be, too, that you don't have to touch the database....with file manager functions...


greetz

PS: need just decompressing of uploaded archives to dir
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

Hi Metti

I downloaded your 0.51 - inserted your code in phpwcms and config - all good - but when I went to the module - the GO button was missing... seems OliG has discontinued distributing it inside img/button directory - anyway I pasted the gif (go01.gif) there and it then showed up in your module - so good so far....

Everything worked except the creating of new 'virtual (phpwcms) directories - so basically had to go to file manager and create the virutal directory first - then it showed up in you upload dialog - uploaded files could then be assigned - so all in all - this is a reasonable way to upload files - but very similar to FTP takeover

To return to the discussion
as Jensensen has suggested

PS: need just decompressing of uploaded archives to dir

seems to make sense - and for me - a more generic approach to the issue - which in the end is not really attempting to integrate into file manager - rather a way to stay in the wcms backend interface and have the ability to upload zips (which could include directory and file configuration information) - very basic really

At the end of the day this is more like a standalone image/file management scheme - like wysiwyg handles it....

In my case I have the need to simply upload a directory AND its structure - so that the Zoomify image matrix is preserved - no file renaming - preserved directory structure...


ie

myZoomify ImageSet_1:Directory
- - ImageProperties.xml (file)
- - TileGroup0: Subdirectory
- - - - Multiple image tiles
- - - - go here (names unchanged)

where
everything is uploaded as

myZoomify ImageSet_1.zip

and gets decompressed in a designated folder

hope this makes sense
User avatar
metti
Posts: 81
Joined: Tue 28. Nov 2006, 07:34
Location: Merseburg
Contact:

Post by metti »

Hm. I thought about a configuration for the unzip-thing in that it's possible to choose a path or to let user choose a path.

The filemanager won't do the rest if you have directories in your archive. Thats one thing i wanted to do in the module.

What do you mean with overwriting existing files? The filemanager changes settings in DB and not to the files (only deleting of course).
In UploadFX changing fileinformation allready works.

If in phpwcms not all files would be stored with a hashname and the same folder it was possible to use another filemanager.
The phpwcms-filemanager can drive you crazy if you have to delete more than 2 files.

But may be you're right and i should not write a module for this.
#GeorgeWBush { position:absolute; bottom:-6ft; }
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Post by Jensensen »

[x]
Last edited by Jensensen on Sat 20. Sep 2008, 17:42, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
metti
Posts: 81
Joined: Tue 28. Nov 2006, 07:34
Location: Merseburg
Contact:

Post by metti »

Oops jws_nz you answered while i wrote :P

Thank you for the report. The sense of UploadFX was to upload files to phpwcms WITHOUT using ftp-takeover because sometimes not all users should have ftp-access and if you are in a internetcafe or something it is inprobably that a ftp-client is installed.

I guess for Zoomify UploadFX is not the right thing because the structure and even filenames are lost in phpwcms-filestorage. You need physical folders and not phpwcms-DB-folders.

@jsw_nz Did you test the unzip-mod? Did it work for you?
The problem is, that there are a few decompression-libraries but i did not find a stable one until now.
And to write such a library i'm not "crack" enough :D

If we speak about uploading files not with ftp you should consider, that on many servers there are restrictions for max. Uploadsize.
#GeorgeWBush { position:absolute; bottom:-6ft; }
User avatar
metti
Posts: 81
Joined: Tue 28. Nov 2006, 07:34
Location: Merseburg
Contact:

Post by metti »

@jensensen: Thats strange. Never heard about this. Do you have a link where i could find more infos about this?
But how i said the mod changes nothing to the files themself only this:

Code: Select all

$sql = "SELECT f_ext, f_hash FROM ".DB_PREPEND."phpwcms_file WHERE f_id=".$delete["id"];
  if($result = @mysql_query($sql, $db) or die('{"error":"fileinfo in database","errmsg":"SQL-query failed."}')) {
    if($row = mysql_fetch_row($result))
    {
      $ext = (!empty($row[0])) ? ".".$row[0] : "";
      if(!@unlink(PHPWCMS_ROOT.$phpwcms["file_path"].$row[1].$ext)) 
        die('{"error":"deleting","errmsg":"File can not be deleted on server."}');
      if(!@mysql_query("DELETE FROM ".DB_PREPEND."phpwcms_file WHERE f_id=".$delete["id"]." LIMIT 1", $db)) 
        die('{"error":"deleting","errmsg":"SQL-query failed. File can not be deleted in database."}');
    }
  }
#GeorgeWBush { position:absolute; bottom:-6ft; }
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

OK - thanks for the discussion guys -

I suppose at the end of the day
- my wish is an expression of my being lazy :lol:

- I know standalone ftp (zip supported) file and directory managers exist out there (ordinarily come with hosting plans) - so I may go hunting for one -

- I was just saying how nice it would be
- to have it accessed in wcms backend...


holiday cheers :D
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post by jsw_nz »

@metti
@jsw_nz Did you test the unzip-mod? Did it work for you?
no
- was unaware of it
- forgive me
- but could you give pointers (url)?

cheers

:)

UPDATE
- found on your site - will try
Post Reply