开发者

FTP-upload with PHP, print simple percentage?

hey guys, i know there are a lot of "for-me-too-complicated" versions of progress-bars for php uploads out there.

however i have only a really basic knowledge of php and i have no idea how to implement this stuff.

i did a working file-upload script that transferres files from the user to my ftp-server. i'm usin开发者_JAVA百科g ftp_connect and ftp_put to do so.

i wonder how complicated it is to print a SIMPLE percentage value on to the page, to let the user know how far the upload has progressed.

i don't want any animated javascript stuff, just a simple percentage that shows the progress.

do you know a tutorial or something, or can you maybe give me a little explanation how i could do that. at least which methods return a progress value.

thank you in advance,matt


I know you said the flash uploaders are too complicated for you and you need a simple solution but the truth is there are none. If you could start your project over I would recommend using some known CMS with file upload support.

I think you should really give something like uploadify another chance. If you have problems with it ask here! There is a uploadify tag and really helpful peoples.

edit after your commenht: As seen on this page theres the idea to use uploadify to get the file to yoru server and then move it normally using ftp to your other space/server.


PHP/Apache talks to the client in a single request only. There is no simple way to actually have the client (know) how far the server is in the process. On uploads the file travels from the client to the server, so we generaly use Flash that can give us that information.

client (flash) -> server

What you are asking is something a bit fancier

client -> server -> ftp

And you want to know the progress between the server and the FTP. Mind you that even if you don't realize it the files are actually beeing transfered to the server and then from the server to the FTP server.

You will probably want to have the server update a database on given intervals with the progress so far and have the client AJAX the server to find out where the server is at.

You can also give socket.io a look!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜