Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
TLove  
#1 Posted : Monday, January 12, 2015 9:16:21 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
Hi,

Is there any way to add a file without using the UI? I want to be able to select a file with a simpler UI and use the Uploader to handle the work of sending the file to the server. I use the provided UI to upload files on our site, but in some cases I only want the user to upload 1 file and don't need to utilize the Uploader UI. This way I could use the same back-end code to handle the upload. I just can't figure out how to call the same event that is attached to the "Add More Files" button. I could most likely figure it out if the aurigma.htmluploader.control.js file wasn't minimized. Is there any way I can get a copy of this file uncompressed? This would go a long way in customizing this product. If not, could you tell me how to add a file using JavaScript?

Thank you for your time.
-Tim
Andrew  
#2 Posted : Tuesday, January 13, 2015 12:12:12 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 870

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
It is impossible to add an arbitrary file from JavaScript - you don't have any access to a file system from JavaScript due to the security reasons.

However in the version 8.1.15 (released yesterday) we have added an addFiles() method which displays the Open File dialog, provided that it was called from a button click event. So you can hide the uploader interface, display a single HTML button and use this method to select a file on a computer.

Something like this:

<button value="files" onclick="$au.imageUploaderFlash('Uploader1').uploadPane().addFiles(); return false;">Add Files</button>

Again, it won't work if you call it outside of a button's onclick event. Browser vendors consider displaying an Open File dialog secure only if a user interacts with a page explicitly.

BTW, the same is true for Flash, that's why this method won't work for the Flash uploader (it would require you to add a Flash button).

Hope this helps.
thanks 1 user thanked Andrew for this useful post.
TLove on 1/13/2015(UTC)
TLove  
#3 Posted : Tuesday, January 13, 2015 4:32:51 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
Perfect! That was exactly what I was looking for. Thank you for your help.
-Tim
TLove  
#4 Posted : Tuesday, January 13, 2015 5:52:20 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
I was able to get this working. But I do have one question. How can I restrict the multiple file select when the file dialog opens? I set the "maxFileCount" to 1, but it is still allowing me to select multiple files.
-Tim
Andrew  
#5 Posted : Wednesday, January 14, 2015 1:28:20 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 870

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
Tim,

Unfortunately it is not possible to disable multiple selection right now, but the idea is great. We will add it to the next update. If the (max file count - total count of upload items) = 1 the Open File dialog will be opened in a single file mode.

Sounds good?
TLove  
#6 Posted : Wednesday, January 14, 2015 4:58:44 AM(UTC)
TLove

Rank: Member

Groups: Member
Joined: 7/25/2007(UTC)
Posts: 17

Thanks: 3 times
That sounds great! I love the support that you guys have for your products. Thank you so much for your time and help.
-Tim
Dmitri  
#7 Posted : Tuesday, April 7, 2015 3:43:28 AM(UTC)
Dmitri

Rank: Advanced Member

Groups: Member
Joined: 6/10/2013(UTC)
Posts: 34

Was thanked: 1 time(s) in 1 post(s)
Hi Tim,

We have released the new Upload Suite 8.5.9 version and you can already download it here:

http://www.aurigma.com/downloads/upload-suite

Please let us know if you need assistance.

-Dmitry
Best regards,
Dmitri Vorobyov
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.