06-04-2008, 06:39 PM
|
#1 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 440
Thanks: 3
|
Aptana Jaxer and file uploads
Hey guys. I need an advice about some paths. Well, I developed a file manager (let's say it's something like the Windows Explorer - a simple system navigator) using Aptana's Jaxer. Now, in Javascript I only have the filesystem paths (on windows they will be like C:/dir/file.jpg, for example). How would I upload these paths using only Javascript and PHP (if possible)? I've tried this, so far:
1. create a hidden form, with a file input inside it. The idea was to populate the file input with one path at a time, and then submit the form inside an iframe or something like that (so I would also get a response from the server). That didn't work, as the file type inputs are read-only. I also tried using a file input and a hidden input with the same name, but that didn't work either.
2. use Jaxer's file management functions (tried to read a local file into a buffer and send pieces to the server to rebuild the file). The only problem is that I receive an error when reading from a non-text file (a JPEG, for instance), where the contents are not in utf-8 encoding. So this won't work, either.
A solution would be to use an additional SWF file for the communication between javascript and PHP, therefore getting the ability to build a progress bar, aswell. But, I can do that from Javascript too, if just I could read the file somehow...
LE: by 'uploading the paths' I mean uploading the files on the local filesystem with that specific path.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
Last edited by xenon : 06-05-2008 at 12:04 AM.
|
|
|
|