upload files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

upload files

Post by Skara »

Yeah, I know you can't auto-upload. I'm not a n00b. :P

But I saw where someone said something about this in another thread, and it got me to thinking. Could you not use javascript to check if a file exists? Even barring that, why couldn't you auto-upload a file? What I'm really asking is how does uploading files work? I just don't many ways you could bar auto-upload, so I'm curious. ^_^
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

I'm sorry, but I don't think I know what you are talking about. What is this post in reguards to? What are you talking about auto-upload? Auto-upload to where? and autoupload what? do you have a coding issue, or is this a general inquiry? :?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Moved to Theory...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

JavaScript can't read files on the local machine. JavaScript is deliberately designed to only allow access the broswer features.

File uploads work like this.

1. You MUST use a file input method in a form.
2. You allow the user to choose the file to upload. The path is stored in memory on the client side.
3. The user clicks submit
4. Binary data is tranferred from the client machine to the server.

There is no way, with a standard web browser alone, to access files automatically and upload them.

If we could access files automatcially on the client side the internet would have taken a lot of stick and we'd all have deleted windows installations or heuristics from the sad few people who like to make other's life a misery.

Is this what you were asking?
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

ah, ok. thanks. was just curious.
Post Reply