LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
creed
Veteran Dog
Veteran Dog


Joined: 08 Nov 2003
Age: 99
Posts: 6361
Location: Exiled

Post Posted: Sun Mar 29, 2009 9:02 pm   Post subject: Need help with file upload form... Reply with quote Back to top  

...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



View user's profile Send private message MSN Messenger
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 27
Posts: 12370
Location: The Constitution State

Post Posted: Sun Mar 29, 2009 11:36 pm   Post subject: Reply with quote Back to top  

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.
View user's profile Send private message
CMTG
Leg Humper
Leg Humper


Joined: 23 Feb 2002
Posts: 5302
Location: /var/log/cabin

Post Posted: Mon Mar 30, 2009 3:38 am   Post subject: Reply with quote Back to top  

It would help if you tell us how exactly it's not working, including error messages, relevant apache log entries, etc. Wink

_________________
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.


The number you have dialled is complex. Please rotate your phone ninety degrees and dial again.
View user's profile Send private message Send e-mail Visit poster's website
creed
Veteran Dog
Veteran Dog


Joined: 08 Nov 2003
Age: 99
Posts: 6361
Location: Exiled

Post Posted: Mon Mar 30, 2009 4:21 am   Post subject: Reply with quote Back to top  

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. Wink


Usually that would help. Smile 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 user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic     Reply to topic

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!