Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

upload files

Posted on 2011-02-27
6
Medium Priority
?
397 Views
Last Modified: 2012-05-11
Hi

is it possible to host upload form in server01 and store file in another server?

currently im using this jquery plugin

http://aquantum-demo.appspot.com/file-upload

Open in new window


and it says plugin is able to

Cross-site file uploads:
Supports uploading files to a different domain with Cross-site XMLHttpRequests.

but i have no idea how to do it..

any help would be great

Thanks
0
Comment
Question by:3xtr3m3d
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
Julian Matz earned 1000 total points
ID: 34990954
Hi! I think this is only supported by Firefox 3, but I'm not certain. Anyway, you can try by either adding this to your PHP file:

<?php
// Change this to allow <yourdomain.com> to make it accessible to your site, or allow <*> for ANYONE to be able to access it.
header('Access-Control: allow <yourdomain.com>');
?>

Open in new window


... Or by creating an XML file with the following:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Change this to allow="yourdomain.com" to make it accessible to your site, or allow="*" for ANYONE to be able to access it. -->
<?access-control allow="yourdomain.com"?>

Open in new window


A .htaccess file might work also.

Some more information:

https://developer.mozilla.org/En/HTTP_Access_Control

Hope this helps.
0
 
LVL 4

Assisted Solution

by:LAMASE
LAMASE earned 1000 total points
ID: 34990981
The upload form in server1 and you want to send you file in another one?
On server 1 your form should simply have action="server2/path/file.php"

With the plugin the easiest thing is to put it on the second server, then call it from the first, depending on how you show the file upload form.
0
 
LVL 3

Author Comment

by:3xtr3m3d
ID: 34990989
Thanks for the quick reply.

$(function () {
    $('#file_upload').fileUploadUI({
        uploadTable: $('#files'),
        downloadTable: $('#files'),
        buildUploadRow: function (files, index) {
            return $('<tr><td>' + files[index].name + '<\/td>' +
                    '<td class="file_upload_progress"><div><\/div><\/td>' +
					'<td class="file_upload_start">' +
					'<button class="ui-state-default ui-corner-all" title="Start Upload">' +
					'<span class="ui-icon ui-icon-circle-arrow-e">Start Upload<\/span>' +
					'<\/button><\/td>' +
                    '<td class="file_upload_cancel">' +
                    '<button class="ui-state-default ui-corner-all" title="Cancel">' +
                    '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
                    '<\/button><\/td><\/tr>');
        },
        buildDownloadRow: function (file) {
            return $('<tr class="ui-state-highlight ui-corner-all"><td>' + file.name + '<\/td>' + 
			'<td>' + file.message1 + file.message2 + file.message3 + '<\/td><\/tr>');
        },
		beforeSend: function (event, files, index, xhr, handler, callBack) {
			handler.uploadRow.find('.file_upload_start button').click(callBack);
		}

    });
});
]

Open in new window


<form id="file_upload" action="upload.php" method="POST" enctype="multipart/form-data">  
<input type="hidden" name="MAX_FILE_SIZE" value="1638400000" /><input type="file" name="file" multiple><button id="start_uploads">Start uploads</button>
</form>


thats my upload form and upload file is handling using upload.php


so if i want to upload file to another server, should i put upload.php on second server and call it from 1st server?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Expert Comment

by:LAMASE
ID: 34990990
Yes.
0
 
LVL 3

Author Comment

by:3xtr3m3d
ID: 34991096
i tried like this

<form id="file_upload" action="remote-server/upload.php" method="POST" enctype="multipart/form-data">  

but nothing happens .
0
 
LVL 4

Expert Comment

by:LAMASE
ID: 34991275
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question