Re: How to "download" a multi-part file at the "server" side?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I just came across http://www.w3schools.com/php/php_file_upload.asp, and
tested it..
It works fine, when the file is uploaded via a form.


It does seem that the client-method might indeed play a role.
Here is my Java code for uploading the file ::


###################################################
        HttpClient httpclient = new DefaultHttpClient();

httpclient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
HttpVersion.HTTP_1_1);

        HttpPost httppost = new HttpPost(URL);
        File file = new File("/path/to/png/file.png");

        // Send the image-file data as a Multipart-data.
        MultipartEntity mpEntity = new MultipartEntity();
        ContentBody cbFile = new FileBody(file, "image/png");
        mpEntity.addPart("userfile", cbFile);

        httppost.setEntity(mpEntity);

        HttpResponse response = httpclient.execute(httppost);
###################################################


Any ideas if making a change at the client (Java) OR/AND server (PHP) might
do the trick?


On Sat, Nov 2, 2013 at 6:06 PM, Ajay Garg <ajaygargnsit@xxxxxxxxx> wrote:

> Hi all.
>
> I intend to implement a use-case, wherein the client uploads a file in
> multi-part format, and the server then stores the file in a mysql database
> (after "downloading it at the server side).
>
> I have been unable to find any immediate answers through googling; I will
> be grateful if someone could start me in a direction to achieve the
> "downloading at server via php" requirement.
>
> (Don't think it should matter, but I use Java to upload a file in
> multi-part format).
>
> I will be grateful for some pointers.
>
> Thanks in advance
>
>
> Thanks and Regards,
> Ajay
>



-- 
Regards,
Ajay

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux