0

hi, I am trying to upload picture using PHP. I made this title because if the thread contains title with tough problem, no one even open thread and try to help.

Actualy i have problem in picture uploading, but critic part is that my code is at one site and i want to upload file on other site, for this i tried to give absolute path to the directory where i want to upload, and full rights to that directory too. But I am not successful. Now please help me out how can i uplaod a file on other domain have code at different domain.

Thanks in advance.

5
Contributors
8
Replies
10
Views
7 Years
Discussion Span
Last Post by accountholder
0

I suspect that you will need to use FTP. I could be wrong but I don't think that you will be able to do a cross-domain upload of a file the way you would on a single site.

0

hi, I am trying to upload picture using PHP. I made this title because if the thread contains title with tough problem, no one even open thread and try to help.

Actualy i have problem in picture uploading, but critic part is that my code is at one site and i want to upload file on other site, for this i tried to give absolute path to the directory where i want to upload, and full rights to that directory too. But I am not successful. Now please help me out how can i uplaod a file on other domain have code at different domain.

Thanks in advance.

Please Help me...

0

I made this title because if the thread contains title with tough problem, no one even open thread and try to help.

Definitely not true and if that has been your experiences in the past with daniweb then that's simply ridiculous. However, onto your question.

The only theoretical (I stress that because I'm only just now contemplating it) way to do that would be to use some kind of automated submission so that when you submit the file to one site, it loads the page with all necessary information and resubmits it over to your other one. But this methods requires php or some kind of server side language that can manipulate files for the image storing end.

In essence, javascript is probably your best bet here as php is limited to the server it's hosted on and cannot access another's. It would make security an absolute nightmare if servers could manipulate each others files.

If you don't mind my asking, why are you trying to accomplish this?

Edited by Nyight: n/a

0

Actually i have four different sites, and i had build same admin for all those 4 sites, now when user add record it goes to thier respective databases via remote database access, but in some cases like when i am storing company information, i need to upload company logo too. In that case i need to upload logo at their respective folders located their own domains.

I hope you understnad what i mean.

Thanks for your reply

0

Well if that's the case then use cron or a cron equivalent that runs once every say 2-3 minutes. This way "it may take time to update across the server." What you could do for your cron is what I described, make a script that "ques" up all requested logo's that need to be distributed and have the cron script "submit" the information to a "listener" file on the receiving end that would take it and process it all.

But again, this listener file would be vulnerable to attacks. Though, again theoretically, it is possible to do this if you have access to server side code on all the sites you are manipulating.

0

Thanks for reply Nyight.... One of my friend suggest PHP FTP Library Usage to transfer files. Now i am looking at it, may be i found my solution over their.

Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.