Large files upload in web browser - php

This is the first time for me asking a question. Hope you'll be able to help me.
Problem: my chef wants our enterprise application to have a module which allows customers to upload very large files to our server.
Infrastructure: php 5.x / mysql client-server app
Well known problems:
-HTTP session time out
-Upload limit in terms of number of files and file size
Rules:
-The solution mustn't use any applet (java, flash, ...), neither any browser plugin.
-The solution should allow users to upload any type of files, from simple images to very large files of any other type.
-For security reasons, we don't want to change the settings in the php.ini file, neither in any .htaccess file to allow the app uploading larger files.
-If a pre-backed solution exists, it should be opensource and possibly free of charges.
-Integration with AJAX functionalities and progress bar visualisation are heavily welcome.
Possible solutions (tell me if it's possible, and if it isn't, why?):
-Access by FTP using some javascript library in the browser
-Access by WebDAV using some javascript library in the browser
Any other solutions that respect the above given rules is also welcome
I know, I'm asking for a very hard thing to find.

What you're asking for isn't currently possible. The only technology for uploading files which is currently available in all widely used browsers is standard HTTP form uploads, which you've already rejected as a solution. All other solutions available require Java or Flash, or use browser JavaScript capabilities (local file access) which are not fully standardized, nor universally available.
You'll need to relax some of your requirements.

Create an iframe or frame, or browser-window that offers access to the server via FTP. Allows users to drop files there for those browsers at least who support FTP.

Related

Access a file on a HTTP server via PHP with any application

In an attempt to add features to an online platform for file sharing, I would like to offer a seamless Integration of the platform content itself with other applications. This Integration should allow registered users to open and edit an uploaded file on the server. In the end the user should be able to open a link, e.g. API.php?File=/Overview.odt, in an editing software of their choice and be prompted the required document.
However, when the user saves the document, it will be saved as a temporary document on their computer (disk). Is there any way to directly access the file not only to open it, but also for saving?
I already looked at the FileWriter specification but wasn't really happy about the browser support...
Thank you for your answers.
You can submit your updated document through a GET or POST HTTP form, with an action field linking to a PHP script in charge of processing your file (if any processing is needed) and storing it somewhere accessible.
You could also rely on the WebDAV extension of HTTP, but those are rarely activated by default on web servers.
Anyway, you should be aware that when designing such features, the risk of introducing vulnerabilities on your website is pretty high.
Also, it is not clear to me how you can expect any possible application to use your interface automatically, unless you set up some kind of Dropbox-like daemon watching a synchronized folder on your local machine.

Need to disable auto downloader from site

Locally, I have developed a music site by means of a WordPress theme, and it's running well. The problem is that once the media file is streaming in the browser, Internet Download Manager(IDM) detects it and generates the download link (That's the nature of IDM) .
So, I want to build my site such that visitors will be able to play and listen to the music, but they are not allowed to download the streaming media by any downloader.
Is there any PHP code, WordPress or jQuery plugin to do this?
Thanks in advance.
If you allow visitors to listen to a file, there is no way to prevent them from downloading it. Even DRM is broken if they are determined enough. If they can play it, they can save it.
That said, you have several options.
Use Flash to stream the file.
It is still pretty easy to download unless the file is embedded in the SWF or uses DRM. This is a common solution, and works well unless you need to support mobile browsers without Flash support.
Only allow one download per IP address.
This has major usability problems and will not work in many browsers. I don't recommend it.
Send the file encrypted and decrypt with Javascript.
Could be very slow, still doesn't stop determined users, depends on Javascript, requires either dataurl support or newer html5 audio apis.
Don't worry about it.
This is what I do.

Virtual file system in php?

We have a system where, a large part of it is the ability to upload and download files if you are logged in and have the correct permissions.
What we are looking at doing to help with the organization from the users point of view is having a virtual file system type layout.
Even if (or even preferably) all the users files are actually just stored in one directory, and the virtual file system is just a screen put up from the database.
What we are wondering before we invest in creating this is if this already exists somewhere, open source (but able to be used in commercial software), free, or paid (first two preferably!).
A simple file system on top of PHP can be done by WebDAV that is built on top of PHP:
http://sabre.io/
This would be a good example, but there are others as well. WebDAV is essentially a web based file system (http://en.wikipedia.org/wiki/WebDAV).
This could not only provide a file system, but also would let you edit files directly with Word/Excel (2007+) in it. Showing then a treeview of folders and files would be quite trivial, using few database tables and some jquery components, such as jsTree and jqGrid.
Although if you are searching for a full document management system: http://www.opendocman.com/ or http://code.google.com/p/simpledoc/ this would be more then enough.
It really depends on how many features you are going to incorporate into this system. Will there be an OCR, would you like to store the files in the cloud service, how many user input there will be (is simple upload enough, or camera, scanners and other devices are needed to be used as well)?
As for the commercial products, you could check out Microsoft SharePoint (http://en.wikipedia.org/wiki/Microsoft_SharePoint) or IBM Lotus Notes (http://en.wikipedia.org/wiki/IBM_Lotus_Notes)

How to reliably upload large files through a web interface

Background:
I have a site that deals with large video files (sports videos). The site allows users to upload any source file, but most of the videos come from DVDs. I am currently using a modified version of jumploader to encode and upload files to the webserver with an HTTP request. The jumploader is a java client, and looking at my webstats, only about 75% of my users have java installed.
What I want:
I have looked for a flash based uploader that transfers a byte stream to a server. Byte streams would be ideal so I can capture partial videos for failed uploads. I have also looked for flash-based ftp clients, but I haven't found anything promising. There are some flash-based uploaders that post via HTTP, and I'm considering this. I do not want to use a simple file post. Some upload methods also put the full file into memory first, and this obviously is not an option for me.
Does anyone have experience uploading large (up to 2-3GB) files to a web (or ftp) server from a web frontend (PHP) with any reliability?
as a flash based solution you can use swfupload, which is widely used because you can display a progress bar. It sends answers back to you which you can read with JavaScript.
We decided upon using Transloadit, a service which is specialised in uploading and encoding video files. You can even track whether a download was aborted by closing the browser window, it has realtime encoding and supports multiple formats. Moreover your files are stored at Amazon S3 so you can easily stream them with AWS CloudFront and JWPlayer or Flowplayer.
See also zencoder.
Cheers

Is is possible to build a cms without using any scripting language on the serverside?

I wanted to know if there is a way to build a CMS using no scripting language on the serverside, i.e. only use server to store data?
Theoretically - yes, but you'll not be able to make it secured.
I suppose it depends on what you define as a CMS. If you just want user authentication, displaying web pages, then this is quite possible to do with a static-serving web server (Assuming it supports authentication mechanisms and SSL).
If you want stuff to be searchable, you'll need SOMETHING server side doing the indexing (the actual search can still be done client side by downloading relevant index files). Or tap into Google, but this only works if you have no security requirements.
If you want to be able to upload stuff, your server needs to handle this as well.
Without specifying exactly what you're looking for, there's no way to answer this question.
CMS stands for "Content Management System". It's basically an organized way to store your content, with some productivity tools (UI, workflows, ...)
Your server can be seen as a CMS :
The http server provides various authentication schemes
The http server provides encrypting (via https)
The filesystem allows you to create, read, update and delete files.
The filesystem provides a way to manage user (and even groups) rights on these files.
The filesystem allows you to organize your files in folders
The filesystem even allows you to reference files in several folders (via symlinks)
So yes, you can use your server as a CMS. All you have to do is define rules for your content management :
folders organisation
files naming conventions
files format conventions
...

Categories