Author Topic: Flash Uploader  (Read 21731 times)

0 Members and 1 Guest are viewing this topic.

Offline teslaman

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
Re: Flash Uploader
« Reply #45 on: December 25, 2010, 12:20:45 AM »
Replace
upload_error_handler : uploadSuccess,
by
upload_error_handler : uploadError,

upload_url: "{.cut||-1|%folder%.}", will not work if you use this code in a page in html (*.htm,*.html)
This macro will works only in a template file (*.tpl) or in a "diff template".

Thanks again SilentPliz for that info. ;) Hehe, yeah I'm normally all for updating too. I just really liked how lightweight 2.2 was....so did my bandwidth, haha. ;D

thank you for your effort.
This is a very useful information indeed.
In build next to #171 (#173) the code for upload was heavily changed for supporting forms.
I guess that's where the problem have been introduced.
If you untick the "only served requests" in the log options, you should get a "Not served: 301 - Moved" in your HFS log. Do you?

Cheers, I'm glad it helped. :)
Yep, I also get the "Not served: 301 - Moved" message in the log.
Edit: I figured out a bit more. I started testing the older versions of Flash Player and it's v10.0.45.2 that doesn't show the 301 error, but instead says "Complete". However, HFS (#271) does still report the 301 in the log. So the builds from #173 and up were throwing the 301, but Flash wasn't catching them until v10.1.53.64. ;)

I found a multi-upload ajax which authorizes the drag and drop towards the browser with individual progress bar, but as they are Christmas and new Year holidays, it will be necessary to wait to have sources later ;)

Cool, nice find! 8) I thought I had found one, but it turned out to be using PHP, arg.

Happy Holidays Everyone! :D
« Last Edit: December 25, 2010, 01:11:33 AM by teslaman »

Offline teslaman

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
Re: Flash Uploader
« Reply #46 on: July 30, 2011, 11:52:23 AM »
Well guys, I have found a new, extremely cool Open Source uploading script! http://www.plupload.com/  ;D

You can upload via Flash, Google Gears, Silverlight, Yahoo!'s BrowserPlus, HTML5 and 4!  :o

I've attached an edited version of the basic JQuery UI script which I have partially tested in Flash, Gears and HTML4/5.

With all of your coding knowledge, I'm sure you guys will see many more massive potentials in this than I can, but here's one of the features that caught my eye. Server Side Image Resizing! I kept it included in the example ul.htm, just remove the comment to activate it. I thought that could be very useful to instantly create thumbnails from an upload. To set a fixed width, just set the width to what you want, but set the height to something huge. Ex: width : 50 height : 500. That way the width will always be 50, but the height will remain in the correct aspect ratio of the image. Vice versa for fixed height.

On another plus side, the setting "urlstream_upload" forces Flash to use URLStream, which bypasses that pesky 301 error in Flash. Unfortunately, it rather limits the upload progress bar functionality and also means the file is loaded into RAM first. But, with Plupload's extensive abilities, I figured that it's a temporary issue that someone with coding knowledge will be able to fix in short order.  8)

Also, it has a "chunking" feature. Apparently that is a PHP feature, but if you add "chunk_size : '1mb'," to the Settings in the ul.htm file, it does upload the file in pieces. There is just no way, that I'm aware of, to reassemble it on the server side. It also plays a role in determining/showing the upload progress. So, I have no idea if that would be a fairly easy feature to add to HFS? Like say, a Upload folder monitor that just re-merges the files once the upload is finished?

Anyways, these have just been my thoughts on it so far, no idea if they are practical, haha. I have had some issues trying to upload large files in Flash, which seems to be a problem that crops up on the Forums there as well. But, that could just be related to using the "urlstream_upload" setting and Flash not being able to handle using that large of a file (700mb) in RAM.

The JQuery UI Widget example is probably too much of a beast, there are simpler interfaces, but it was the easiest for a scripting n00b like myself, hehe. I imagine it is possible to write up a similar upload progress indicator like the one found in SWFUpload, not to mention who knows what all else that can be done with it.

Enjoy!

Offline Dragon_Hunter

  • Occasional poster
  • *
  • Posts: 52
    • View Profile
Re: Flash Uploader
« Reply #47 on: July 30, 2011, 02:40:42 PM »
Hi

What is needed to get it to get it working and starting ?

Offline crazyboris

  • Tireless poster
  • ****
  • Posts: 140
    • View Profile
Re: Flash Uploader
« Reply #48 on: July 30, 2011, 06:26:37 PM »
if you use this on a webserver you have to set the chmod to 777 for it to work.(on upload folder)
then your server is unsafe.
just upload a phpshell and own the whole server.

Offline teslaman

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
Re: Flash Uploader
« Reply #49 on: July 31, 2011, 06:08:06 AM »
Hi

What is needed to get it to get it working and starting ?

Just unzip the attached file into a folder that has upload permission in HFS and edit the ul.htm file in Notepad if your upload folder isn't called "Upload". Change "/Upload" to whatever your upload folder directory is, save it and voila! It isn't HFS template based yet, so just open the link to the ul.htm in your browser, like a regular webpage.

if you use this on a webserver you have to set the chmod to 777 for it to work.(on upload folder)
then your server is unsafe.
just upload a phpshell and own the whole server.

No idea on PHP security and chmod since the primary use for this that I was suggesting is for HFS, to which none of that would apply.
« Last Edit: July 31, 2011, 08:59:32 AM by teslaman »

Offline r][m

  • Tireless poster
  • ****
  • Posts: 347
    • View Profile
Re: Flash Uploader
« Reply #50 on: July 31, 2011, 04:50:47 PM »
Don't know about the security issue mentioned, but since HFS doesn't
support php, etc, I wonder if it should be a concern,

My testing shows it to work on Ubuntu 11.04/Wine, and being able to
select and upload a list of several files at once is a much needed missing
feature of HFS.

I'm going to try adding it either to my tpl as a [section] or as a remote tpl.
Changes to the css, and adding breadcrumbs, etc, and I think it has potential.
Thanks for sharing.


Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: Flash Uploader
« Reply #51 on: July 31, 2011, 05:08:09 PM »
I managed to take the google gears api of plupload and integrate it right into my site.   Even neater is that i made it pop up with $.prompt. I'll post a template later...

« Last Edit: August 01, 2011, 02:45:39 PM by raybob95 »

Offline r][m

  • Tireless poster
  • ****
  • Posts: 347
    • View Profile
Re: Flash Uploader
« Reply #52 on: August 01, 2011, 03:47:41 AM »
I managed to take the google gears api of plupload and integrate it right into my site.   Even neater is that i made it pop up with $.prompt. I'll post a template later...

I'd be interested, if you'd care to share it  :)

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: Flash Uploader
« Reply #53 on: August 01, 2011, 03:07:40 PM »
And here it is!  Obviously you will need Google Gears for this API to work however it is easily interchangable to flash, html5, etc.  Here's a comparison of the various APIs.  Add the 4 js/css files to a folder called 'plupload' in your root, then copy over this template, which is the build 279 default but with the following changed to it:

Added the necessary external scripts to the template
Deleted all the upload button hiding, progress refresh etc. stuff in lib.js
added the new upload script to a section just before [box actions]
added the new upload button to the [box actions] section
changed the max width of the impromptu prompt

Also as far as the chunking thing is concerned (because even with max_file_size set the max is still 2GB per UPLOAD and so will freeze with any more) perhaps it would be possible to reassemble the file on the server by HFS, using very small chunks and then something like {.save|wholefile.txt|{.load|blah.part.}{.load|blah2.part.}.}   Just a quick thought...

EDIT:  That template is the HFS default not by RAWR-designs, but I'm sure it could be done just as easily.
« Last Edit: August 01, 2011, 03:18:33 PM by raybob95 »

Offline teslaman

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
Re: Flash Uploader
« Reply #54 on: August 02, 2011, 06:37:40 AM »
Nice work raybob95! Looks like this plupload script might finally be the winner for multi-file uploading.

Yeah I was wondering about the chunking too. I saw that rejetto had mentioned chunking when it came to "downloading big files", so I'm hoping something similar might also apply to uploading as well. Here is the topic about it: http://www.rejetto.com/forum/index.php/topic,7699.0.html

EDIT: Great news and sad news... I managed to fix the 301 Error in Flash! ;D The sad news, since plupload doesn't retry on an error, it only half works. However, since SWFUpload does have "requeue_on_error", it works 100% now. ;D Unfortunately, uploading to a protected folder still does not work in SWFUpload, but it is working in plupload.

Here's the fix for SWFUpload:
Code: [Select]
upload_url: "http://"+window.location.host+"%url%",Edit swfupload.js and for the setting "requeue_on_error" change it from false to true.

I have no idea why Flash fails on every other file, but the retry solves it nicely. You will have to be paying very close attention to see the error message blip by for a millisecond before it requeues and finishes successfully.

The url is the same for plupload, but since it can't retry on the I/O error, every other file fails to upload. It also breaks the protected folder uploading when you remove the urlstream setting. So I don't know how we would have 100% working Flash and uploading to protected folders at the same time. :(

So, In summary, if you don't use protected folders for uploading, SWFUpload is now fixed.
« Last Edit: August 03, 2011, 03:55:45 PM by teslaman »

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: Flash Uploader
« Reply #55 on: August 11, 2011, 01:55:45 PM »
The only issue I'm having with PLUpload is that once an upload completes, it waits around 45 seconds before completing the upload, meanwhile in HFS the connection is stuck on 'thinking'.  Not sure if this is a bug with PLUpload or with HFS bu I would really like it resolved.  I only have a basic knowledge of JS so I'm stumped.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Flash Uploader
« Reply #56 on: August 22, 2011, 04:15:55 PM »
No idea on PHP security and chmod since the primary use for this that I was suggesting is for HFS, to which none of that would apply.

correct

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Flash Uploader
« Reply #57 on: August 22, 2011, 04:17:02 PM »
The only issue I'm having with PLUpload is that once an upload completes, it waits around 45 seconds before completing the upload, meanwhile in HFS the connection is stuck on 'thinking'.  Not sure if this is a bug with PLUpload or with HFS bu I would really like it resolved.  I only have a basic knowledge of JS so I'm stumped.

is this easily reproducible on my own?

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
Re: Flash Uploader
« Reply #58 on: September 28, 2011, 12:43:25 AM »
Yeah see my new bug report topic although PLUpload isn't the source of the problem, luckily.

Offline teslaman

  • Occasional poster
  • *
  • Posts: 17
    • View Profile
Re: Flash Uploader
« Reply #59 on: April 06, 2019, 12:45:59 AM »
Hey guys, did anyone ever have any luck working out the chunk option with PLUpload? I've been using PLUpload for all of these years without chunking, but I'm using Cloudflare protection now and they only allow 100MB uploads, which means I need the chunking option.

Uploading works with chunks and renaming enabled, but I end up with split files with file names, "blob", "blob (1)", etc. I've looked at the code, but I'm lost on this one. I can merge them manually with a file merger, but there's also no indication as to what the original file name was.

raybob mentioned this:
Quote
{.save|wholefile.txt|{.load|blah.part.}{.load|blah2.part.}.}
but I don't know how to implement something like that into the PLUpload code. I'm guessing it'd have to go into a form action, where it would then somehow check for a successful upload before executing. Beyond that...  :-\