Upload Empty Folder Structure?

Upload core product.
Clemens
Posts: 5
Joined: Fri May 13, 2011 7:55 am

Upload Empty Folder Structure?

Post by Clemens »

Hi,

Currently we implemented a scenario in which it is possible to upload a folder with all it's files and folders beneath (recursively). This works perfectly except for subfolders that contain no single file.

Is it also possible to upload an empty folder or is this not supported by JFileUpload?

We configured the HTTP upload applet with the "relativefilename" parameter and with the "folderdepth" parameter.
On server side we are using the JSPUpload script.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload Empty Folder Structure?

Post by support »

Try to add:
<PARAM NAME="param5" VALUE="emptydirectory">
<PARAM NAME="value5" VALUE="true">

Does it help?

Clemens
Posts: 5
Joined: Fri May 13, 2011 7:55 am

Re: Upload Empty Folder Structure?

Post by Clemens »

Hi,

Thank you very much for the quick reply!
This was indeed the parameter that was missing, so now it works like a charm.

Clemens
Posts: 5
Joined: Fri May 13, 2011 7:55 am

Re: Upload Empty Folder Structure?

Post by Clemens »

Hi,

Now I have yet two further questions:

- When we try to upload a folder that contains no single file but e.g. just another empty subfolder, nothing happens. It seems that there is no uplod request triggered by JFileUpload. Can we bypass this behaviour in some way or does JFileUpload always assume that there is at least one document to be uploaded?

- Is there a way to also output information messages in the applet about folders being uploaded (respectivley created on server side)? In other words: Is there a generic way to send messages from server side to the applet that can then be displayed in there?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload Empty Folder Structure?

Post by support »

You need at least one file to upload to generate a request. Uploading just empty folders is not available.

You can display custom error message (generated on server-side) with "errorheader" parameter. See PHP sample script at: http://www.jfileupload.com/products/tools/index.html
<PARAM NAME="param2" VALUE="errorheader">
<PARAM NAME="value2" VALUE="custommessage">
Then in the PHP:

Code: Select all

 header("HTTP/1.1 405");
 header("custommessage: ".$errormsg);

Clemens
Posts: 5
Joined: Fri May 13, 2011 7:55 am

Re: Upload Empty Folder Structure?

Post by Clemens »

Hi,

Ok thanks firstival for your reply.

I modified the applet's source code so that it is also possible now to upload completely empty folder structures.
I wouldn't say that the original behaviour is a bug, but I would say that it is in some way inconsistent, because it is indeed possible to upload empty folders (if there is at least one file in the whole transfer request), so this might confuse the end user (because for him this doesn't make a difference). Maybe it would be reasonable to also fix this behaviour in some future version of JFileUpload?

For the second question:
I knew the errorheader-parameter, but this obviously makes only sense for errors, so I think the answer to my second question is also that this is not possible unless you modify the applet's source code. Because I already modified it to allow upload of completely empty folder structures, I also included messages for creating empty folders, so this also works now for us.

truongvu
Posts: 39
Joined: Wed Oct 26, 2011 11:58 am

Re: Upload Empty Folder Structure?

Post by truongvu »

i can't upload folders
, it only move files in folders to destination folder
i get version 2.8 's applet source code , but it can't upload folder !
which param in file javascript i can upload empty folder ?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload Empty Folder Structure?

Post by support »

The following does not work?
<PARAM NAME="param5" VALUE="emptydirectory">
<PARAM NAME="value5" VALUE="true">

vlad
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Upload Empty Folder Structure?

Post by vlad »

I've set the parameter and the applet shows like the empty folder is being uploaded, but no actual HTTP request is made, except for the file that needs to be in the drop for it to react.
I am using the following options:
mode http
httpmethod post
folderdepth -1
chunkmode onflyrange
relativefilename true
emptydirectory true

Thanks!

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Upload Empty Folder Structure?

Post by support »

Do you have at least one file to upload?

Post Reply