Forum > General

How to copy file to web

(1/4) > >>

bobonwhidbey:
i have no problem downloading files from my website using fphttpclient. I'd like some help writing a file back to my web site. This is the sample coding I saw


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function PutFileContent(URL: string; Response: TStream): boolean;begin  Result := False;  with TFPHttpClient.Create(nil) do  try    Put(URL, Response);    Result := True;  finally    Free;  end;end;
but it gives an error
..exception class 'EHTTPClient' with message
Invalid protocol: "C"

For sure I would need a Username and Password, perhaps some other info, but it's not clear how to provide that.

What's an easy way to write a file to my web site? Does it depend on text or binary file?



Warfley:
It depends, how is the Website upload function implemented? If the http server does not implement a way to upload files via post or put you can't use it that way

TRon:
As warfley already mentioned.

Since it is your website  you would have to implement functionality for being able to upload files (or make use with whatever CMS is in place).

Usually hosting companies offer shell or ftp access which you can use for maintenance (including uploading files).

bobonwhidbey:
I can upload files using Filezilla or FireFTP without a problem. I want to upload them using a Laz app.

TRon:
Is your aim to let users of your website be able to upload files (including yourself) or is it only meant for you (the owner of the website) to be able to update your website (e.g. upload html pages, pictures , php scripts etc) ?

In case the latter you can use ftps or sftp protocol to upload files (the choice depends on what protocol  your host supports, see your filezilla/fireFTP settings ) . In case the former there is need to have something running on your server that is able to accept file uploads.

Depending on the answer(s) there are different paths to take.

Navigation

[0] Message Index

[#] Next page

Go to full version