Page 1 of 1

Upload file with only entering a URL

Posted: Thu Oct 19, 2006 5:22 am
by msrox
Hi all
I want to upload file using php with only entering a url in the IE such as this:

For example :
I want to upload file pic.jpg and its local path is e:\folder1\pic.jpg, is there any php file to get this url :

http://www.mysite.com/folder/upload.php ... r1\pic.jpg
http://www.mysite.com/folder/upload.php ... r1/pic.jpg

Is it possible?
Please guide me
Thanks in advance

Sincerely yours
msrox

Posted: Thu Oct 19, 2006 5:39 am
by Mordred
No, you can't you must use a file upload form.

Don't you find it scarry that in yout scenario a random server on the web would be able to access a random file on your disk?

Posted: Thu Oct 19, 2006 7:17 am
by msrox
My porpuse is uploading file from another application such as my app which coded by delphi,
for example , my app captures desktop and saves it on c:\1.jpg, then it wants to upload it to my site automatically, if it use form for uploading, user much fill it and then click on submit, but I need my app do it without any dependency to user,

Is there any way to even fill form and click submit automatically?
I do not want to send files with FTP or sending via SMTP
Please guide me,
thanks in advance
msrox

Posted: Thu Oct 19, 2006 7:20 am
by feyd
Last I checked, Delphi had the ability to perform background website interactions including file uploads like a "normal" browser.

Posted: Thu Oct 19, 2006 7:24 am
by Cameri
If you made a program in delphi... you can just send an HTTP POST request to the server from your own program, but this is not the forum to go to for this kind of help. Remember, what you must find out now is how to send HTTP Requests using delphi, my suggestion is that you visit Delphi Pages (that's the name of the website).

Posted: Thu Oct 19, 2006 7:39 am
by msrox
Thank you very much for your response

But my big proble, is firewall, if I create a url and then execute a hidden IE and enter the url on it, IE connect to internet, and firewall does not show any alarm,
but If my app connect to internet directly, firewall shows the user that an application is trying to connect to internet and if user blocks it, my app fails

so i'm trying to create a php and a url for uploading a file only by entering that url in IE,
even if I can attach and send email by entering a url, my problem will be solved,
I did it (sending email by entering a url in IE by the help of my app, but I don't know how can I attach it a file)

please guide me to solve this problem

sincerely yours
msrox

Posted: Thu Oct 19, 2006 8:01 am
by Mordred
Again, think of the horror if it were possible to generate a form for a file upload with the filename in question already filled.

If your users care about your application, they will allow access to the internet.

Now, are you telling us that you want to send that file in secret from the user?

Posted: Thu Oct 19, 2006 8:01 am
by feyd
It's not possible to attach a file to a URL unless the file is insanely small. It would likely have to be under 1K in size. Your users should have the right to deny the file being uploaded as it is their information you are capturing. Trying to hide it will only irritate users if they find out, which likely many will.

Posted: Thu Oct 19, 2006 8:30 am
by msrox
- Yes I want to upload files in secret even in MY pc, I do NOT want to see any firewall alarm

- I don't want to "upload file in url", but I want to "send its location on local pc in url",
for example

When you use a form (POST method in PHP) to send email, you enter in "to", "from", "subject" and "body" textboxes and then click on send, and then an email is sent

ALSO You can do it with GET method in php by entering this url in IE:

http://www.yoursite.com/email.php?to=ja ... body=hello

when you use form (POST Method in PHP) for uploading file from your computer you browse and enter the file path in the textbox (file type) and then click submit and then that file is uploaded

NOW I want to use GET Method in PHP for uploading file with entering a url in IE such as bellow:

http://127.0.0.1/send/send.php?person=m ... javad\f.rm
http://127.0.0.1/send/send.php?person=M ... vad%5Cf.rm

Hope to help me

Posted: Thu Oct 19, 2006 8:37 am
by msrox
It should be noted that my PC is behaind firewall and NAT which I can not connect any application to network, even I can NOT allow or block them from accessing to net and only IE can access to net, this is WHY i am trying to upload files from my pc without any user input even when I am NOT behind my computer,

I want to set my app to capture and upload screenshops for example every 30 min.

I NEED YOUR HELP

Posted: Thu Oct 19, 2006 9:01 am
by feyd
It's not possible. It never was, and never will be.

Posted: Thu Oct 19, 2006 9:07 am
by msrox
:(