PDA

View Full Version : browse to file and send



Vectar
April 11th, 2007, 10:41 AM
i'am building a website that has a page where people can download a schedule as a PDF file.
This is the only thing that changes every week on the site.
Now i want to make a page where the owner can login and then goes to a page where a browse button is displayed when he clicks the browse button he can select the newest version of the pdf from his harddisk. and then click send to upload it to the server where it refresh the last version.
Is this possible ? and how can i make this ?
Does somebody have a tutorial ? or even the script ?

The login part is no problem only the browse to file and send to server part.
Would be nice if this can be done with PHP

duncanhall
April 11th, 2007, 10:59 AM
http://www.google.com/search?q=php+file+upload

Vectar
April 11th, 2007, 11:37 AM
hey thanks.
only one question. None of the tutorial results need to login to the server.
I mean they cant just upload like that, i need to login to the server someway right ?

duncanhall
April 11th, 2007, 11:40 AM
The login part is no problem only the browse to file and send to server part.


Really?

Just have the user login, and then present them with whatever upload system you create.

evildrummer
April 11th, 2007, 11:51 AM
1) create login system,
2) If login correct set sesssion
3) Redirect to upload system file (PHP)
4) Check session, if correct then allow upload, if not redirect

Vectar
April 11th, 2007, 02:26 PM
with the login part i ment a password protected area (that was not a problem to build for me) But not the login to the server part. I will see what i can do with all the info you guys gave me thanks for the help

duncanhall
April 11th, 2007, 02:55 PM
Unless I'm missing something, there is no "log in to the server". People can use you server without logging in, unless you specify otherwise. When you create a login system, that is what people are logging into, your system.

If you have a login system that works, put your file uploader in the area that you have to login to. That way, people must login to your application and use your file uploader.

If you wanted them to use it without logging in to anything, you'd just stick it before the login page of your application.

Either will work, but you want the first option.

Vectar
April 11th, 2007, 03:20 PM
hey let me explain exactly what i wanted.

First i have the www.site.com then when i want to change the pdf file that people can download from the site i go to www.site.com/login.php so i can login to a secure page that will have the browse button where i can search for the new pdf on my harddisk and then upload it to my server.

THe login.php page (secure area login) i can fix.
The upload system i couldn't fix.
In the tutorials i found all tutorials dont specify the server where the file needs to be uploaded to. Thats why i didn't understand how to upload a file to a server.
I mean the page needs to know where the file needs to be uploaded to right ?
you cant just say upload and its on the right server

duncanhall
April 11th, 2007, 03:30 PM
It will be uploaded to your server. The server that you have your php login / upload scripts on. You don't need to specify.

These two tutorials should be able to explain enough between them:

http://www.tizag.com/phpT/fileupload.php
http://www.w3schools.com/php/php_file_upload.asp

Vectar
April 11th, 2007, 03:49 PM
okay that explains alot
so its a wise thing to secure that upload page with a password or else everybody can upload to the server am i right ?