|
LITTLEBLACKDOG.COM
|
| Author |
Message |
creed
Veteran Dog


Joined: 08 Nov 2003 Age: 99 Posts: 6371
Location: Exiled
|
Posted:
Sun Mar 29, 2009 9:02 pm Post subject: Need help with file upload form... |
|
...before I tear what's left of my hair out.
What I'm trying to do sounds pretty simple. I create a form with some spots to upload files, when you select a file to upload it goes to another script, done in php, to validate file and then upload it into a directory, while passing back the status of said upload so I can display it to the user. Picture how google mail handles attachments for lack of a better example. All the whole having it so if there's a file selected the browse button is disabled, and as long as there's a file uploading, the submit button to proceed is disabled.
To me it sounded simple, but after two days of beating my head against code I'm wondering if I've got a case of the terminal dumb. has anyone ran into something like this, and more importantly, has anyone ever done it successfully? I'm sure it's something very simple but as of right now I'm totally lost. Help! |
_________________ The Seven faces of Creed
     
|
|
|
|
|
Lycander
Lead Dog


Joined: 24 May 2002 Age: 27 Posts: 12393
Location: The Constitution State
|
Posted:
Sun Mar 29, 2009 11:36 pm Post subject: |
|
I did a quick Google for "ajax file upload" and found quite a lot of tutorials such as this one: http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html
Sounds like what you're trying to do is have users upload a file without leaving the current page by POSTing the form. The above link is an example that ties it in with PHP, but you'll really want to have a good handle on Javascript and AJAX.
There are AJAX frameworks that make it easier to work with, jQuery is one of my favorites. Do a search for "jQuery file upload" and you should find lots of plugins and code that already deal with the issue. |
|
|
|
|
|
|
CMTG
Leg Humper


Joined: 23 Feb 2002 Posts: 5449
Location: /var/log/cabin
|
Posted:
Mon Mar 30, 2009 3:38 am Post subject: |
|
It would help if you tell us how exactly it's not working, including error messages, relevant apache log entries, etc. |
_________________ Pie. I wish I could
constrain my hungry greed but...
Sadly, defeated.
Charlene's Law: There's no such thing as can't.
Charlene's Corollary: Unless it's followed by be arsed.
I write more quotes than a fucking big book of quotes. - Scroobius Pip
http://fedoraproject.org/get-fedora
|
|
|
|
|
creed
Veteran Dog


Joined: 08 Nov 2003 Age: 99 Posts: 6371
Location: Exiled
|
Posted:
Mon Mar 30, 2009 4:21 am Post subject: |
|
Lycander wrote:I did a quick Google for "ajax file upload" and found quite a lot of tutorials such as this one: http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html
Sounds like what you're trying to do is have users upload a file without leaving the current page by POSTing the form. The above link is an example that ties it in with PHP, but you'll really want to have a good handle on Javascript and AJAX.
There are AJAX frameworks that make it easier to work with, jQuery is one of my favorites. Do a search for "jQuery file upload" and you should find lots of plugins and code that already deal with the issue.
Yep found that one previously, along with a few others. I think where my issue is the javascript/AJAX section. My javascript is pretty rusty, and never used AJAX before. was afraid that might be the way Id' have to go.
The closest that I found to what I was after was this one (http://www.seemysites.net/projFolder/uploader/), where when you select the file it automatically uploads and provides a rudimentary upload bar. What I'm confused about is why it needs to have a form for each upload box (thereby preventing me for posting the filenames for use in the following page), and how to display the progress bars (it seemed to either be an all or nothing shot, and couldn't really find where it was getting the information back to display)
Maybe I'm in over my head, but figured what the hell, give it a try.
CMTG wrote:It would help if you tell us how exactly it's not working, including error messages, relevant apache log entries, etc. 
Usually that would help. I guess what I'm trying to say is while I've found a few examples, I have really no idea where to start to implement them the way that I want, or if it's even possible. |
_________________ The Seven faces of Creed
     
|
|
|
|
|
|
|
|
|
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB
© 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours
Help us keep advertisements off this site. Donate today!
|
|