I am after a jQuery/PHP means of allowing a user to drag and drop files and then via PHP, upload one or more files to a specific directory on a Linux box.
I only have Firefox 3.6 as my base browser but can also move to FFox if need be.
Can use any HTML5 features as long as I'm using Firefox 3.6
Can someone possibly point me to any examples/sites where this process is demonstrated?
I have had a look at http://www.plupload.com/index.php but this does not work in IE6.
As mentioned, would like it to work in FFox only.
Looking for a solution that does this on IE 6 is really, really building a stall for a dead horse IMO.
It may perhaps be possible using some proprietary - and likely commercial - ActiveX or Java plug-in - I'm not sure. But why go through that, when native support is around the corner in HTML 5?
Firefox 3.6 is the one browser that at the moment provides best support for it, so I would recommend to target that for the moment, and other browsers as they catch up in functionality... Whatever you do, I would really not waste time trying to get stuff like this working in IE 6 except if there is a really, really compelling reason why that specific browser has to be supported.
Related
From Google I have found that there are a lot if issues regarding Firefox's built in "Preview option" for PDF's. Workarounds found is to basically disable the PDF viewer and use anther one. Unfortunately from a developers point of view, this is unacceptable as I will be unable to tell users to disable the previewer. I am asking the group am I doing something wrong, which is causing FireFox's Previewer to choke? basic few lines of code I am using to display the pdf is below. Am I missing something with my headers? Please note that the code works on IE and Chrome, as well as firefox if I change the viewer.
<?php
header("Content-type: application/pdf");
echo $fileData;
?>
How the page renders with previewer enabled:
Frankly I can't figure out why we're wasting resources on re-inventing the wheel (ie, trying to replace Adobe Reader extensions); not to mention that so far I have not seen a single "replacement" -- including Chrome, etc. -- that offers the complete page zooom, format and viewing controls. Why don't we spend that energy on solving the print interface issues!! Or the fact that Firefox leaks like a sieve and crashes catastrophically when it mis-handles memory requests. Sure, Chrome leaks too but it does handle memory requests perfectly. For example, Firefox crashes pretty reliably once the Paged memory gets more than 2GB above my 3.5GB system RAM. But Chrome runs happily at 4-5GB Paged memory above that same system RAM and I only restart it because the system slows below usefulness; it is only an old Pentium D after all. Which brings up another point. Years ago we used to make fun of Microsoft for their "bloatware" OS. Well, boys and girls, those same laughs now apply to all your "modern" software. Assembly might be harder but it sure was smaller and quicker.
If the PDF renders Firefox spawning the external Adobe reader and other browsers, then you are doing everything right and the issue is with the PDF.js rendering.
What can you do about it? Best solution is to fix the underlying issue in the PDF that is choking pdf.js -- could be font issue, or a text layer issue, or a few other things. How do you find out what that issue is? Try appending #disableWorker=true to your URL.
For example, open these URL in Firefox with the pdf.js enabled:
http://www.vd.ch/fileadmin/user_upload/organisation/dinf/sm/fichiers_pdf/TP2020_sm_061010.pdf
http://www.xfront.com/URLversusURN.pdf
Notice it gives you the warning or doesn't show up at all? This is expected, bugs have been reported against both these. Now append the debug line:
http://www.vd.ch/fileadmin/user_upload/organisation/dinf/sm/fichiers_pdf/TP2020_sm_061010.pdf#disableWorker=true
http://www.xfront.com/URLversusURN.pdf#disableWorker=true
Either no more error or at least the contents show. Not a magic bullet, and this might not work for you, but now you can follow the debugging guide to figure out what is going on and fix it in the PDF itself.
append #disableFontFace=true to the URL
Looks like a defect in PDF.js (one of hundreds). Since some time Firefox comes with a PDF reader implemented in javascript, which frankly should never have been put into production in the state that it is now.
Feel free to file a new issue for PDF.js, attaching your PDF file.
I am using Coda 2 and MAMP Pro. Many sites I have built work great with the pair, and when it works, it works. By allowing me to specify a Site-Specific URL and then letting Coda know what that URL is, the preview feature works fantastic. Until I started using CakePHP...
The problem is that say I specify the URL "myawesomesite" and point it to my local site directory in MAMP Pro, and then run the servers. I can navigate to "http://myawesomesite:8888" and everything works great, even on sites using CakePHP. However, when I click "preview" in Coda, even after specifying the correct Local URL, Coda tries to append the file structure (as it should in most cases) to the URL. Meaning that I get a URL like this: "http://myawesomesite:8888/app/View/Passes/index.ctp"
Is there any way to override the normal URL formatting of Coda 2's preview function? Or any other solutions?
I also use Coda 2 and CakePHP, and have the same issue. I've searched a lot and I'm 99.9% certain there's no way around it. Lots of people using web frameworks with Coda have the same problem, so it could be worth asking Coda for the feature - they're pretty responsive.
In terms of other solutions, I've started using Live Reload (http://livereload.com/). I work with two monitors, and have Coda in one screen, and Firefox open in the other. With Live Reload, whenever you save a file in Coda, Firefox will refresh and show your changes. No need to switch applications or press any keys, just code and glance over at your other window to see your changes. It's pretty awesome, but requires two monitors, or at least one big screen, to work really well.
I'm looking for a tool to facilitate mulitple webpage file uploads from a single file browse dialogue. I know this has been asked previously, but I can't find anything current.
I'd like to check file size prior to upload, and I gather Flash is still the only way to do that cross-browser?
Ideally, I'd like an upload progress metre. I'll be using Linux and Apache servers, but don't have access to install add-ons such as PHP APC. Again, I assume something flash-based is the only option there?
I've looked at SWFUpload, but that appears to be another of these projects where the developers have become quite zealous and turned a simple concept into a full suite of tools for the masses. It seems quite cumbersome and I don't think I want to use it for my purpose.
I'd prefer not to have to write something from scratch for this. Could someone recommend me something or perhaps suggest a non-Flash alternative if there is one? I do need full cross-browser compatibility without too many layers of degradation, so anything HTML 5 probably isn't what I want.
Thanks
As I mentioned earlier today ( Multiple file upload (client side) )
I am a big fan of Plupload which can check file size, show progress bar, single dialog for multiple files, and supports things other than Flash if needed.
There exists numerous solutions on generating a thumbnail or an image preview of a webpage. Some of these solutions are webs-based like websnapshots, windows libraries such as PHP's imagegrabscreen (only works on windows), and KDE's wkhtml. Many more do exist.
However, I'm looking for a GUI-less solution. Something I can create an API around and link it to php or python.
I'm comfortable with python, php, C, and shell. This is a personal project, so I'm not interested in commercial applications as I'm aware of their existence.
Any ideas?
You can run a web browser or web control within Xvfb, and use something like import to capture it.
I'll never get back the time I wasted on wkhtml and Xvfb, along with the joy of embedding a monolithic binary from google onto my system. You can save yourself a lot of time and headache by abandoning wkhtml2whatever completely and installing phantom.js. Once I did that, I had five lines of shell code and beautiful images in no time.
I had a single problem - using ww instead of www in a url caused the process to fail without meaningful error messages. Eventually I saw the dns lookup problem, and my faith was restored.
But seriously, every other avenue of thumbnailing seemed to be out of date and/or buggy.
phantom.js = it changed my life.
I need to create Snapshots / Thumbshots / Site preview a-site.com.
There are some site as thumbshot.org that meets with I need. But I do not want to use an external service, not to depend on others for my project (What would happen if they close the site?)
For this reason, I am looking for some project to let me do this.
Any idea?
On windows you can use GD's imagegrabwindow() function.
Edit: The help page actually shows you how to grab a screenshot from IE.
There isn't anything in the PHP library to do this - you're looking at setting up an external application (with a queue) to take images, although you can of course use PHP to add items to the queue.
There are a couple of Windows functions in GD that takes screen shots of the computer (webserver - not the client) so perhaps you could write a script in PHP to do this.
Edit: Was thinking of these: imagegrabscreen and imagegrabwindow. I'm not sure they will do what you want however (even in full screen mode Firefox has ablue bar at the top of the screen - not sure about other browsers). However, Pierre has something on these functions if you're interested.
I'd suggest writing an application in another language (I assume .NET has something) to do this for you.
Edit: This page tells you how to do it in C#
There's not much PHP would do for you in this situation. You'd need a complete (X)HTML rendering engine with CSS-support, possibly also with JavaScript support.
That, or use some kind of kinky script that would launch a real browser, and take a screenshot out of that. Either way, PHP is probably not the right tool for the operational part.
There's a Firefox extension that converts the webpage you're viewing to an image:
http://www.screengrab.org/
http://addons.mozilla.org/en-US/firefox/addon/1146
If you're willing to get creative, it might be possible to access this problematically.
Thanks to all.
I found a pseudo-solution, (using dcom + imagegrabscreen + wamp).
I need to resize the final.png with gd, because the png is equal to resolution of client (in my home, is a picture of 1650*1280).
Whe I end this, I will post a .zip file to dowload
Thanks again
(But if anyone have a better idea, I am happy to see that)
PS: Sorry for my english