Reputation: 9807
I have made a Flex+PHP based application in which there is a functionality to upload a picture to the server. The application uploads a picture fine if run on Windows. But on Ubuntu, file is not getting upload at all. Can it be permissions related issue?
Here is the log maintained while uploading a file:
Uploading 5408_1243356204478_1246540615_30751024_3730562_n.jpg...
File opened
File upload in progress (349 of 31340)
File upload in progress (349 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
File upload in progress (31340 of 31340)
HTTP error occured -
HTTP IO error occured -
Also, I tried this app on an OpenSuSE machine and the uploading just worked fine there.
My application's path: /var/www/bin-release Permissions of /var/www/bin-release/*
owner,group = baltusaj,www-data files,directories = 777,777
I have also added baltusaj to the www-data group in /etc/group
The HTTP I/O error is still there, dancing around my nerves. :(
Upvotes: 2
Views: 3781
Reputation: 9807
Thank you all for trying to help. :)
I replaced following line
public var uploadFile:String = "upload.php";
with
public var uploadFile:String = "http://localhost/bin-release/upload.php";
which made the app work on Ubuntu. It was working on OpenSuSE with just 'upload.php' too though.
Upvotes: 0
Reputation: 856
I faced a similar issue in Flex + Java in Mac Safari browser. I fixed it using the urlRequestVariable and altering the response from services.Hope that might help you.
Solution:*1. Create an urlRequest variable and set the file upload URL.*
For example, var request:URLRequest=new URLRequest(); request.url=http://localhost:8080/projectContext/upload/";
2.Use URLVariables to set the request data [Now REST interface and userObject is the queryparam]
var sendVars:URLVariables=new URLVariables();
var user:Object = new Object;
user.firstName ="XXX";
user.lastName="YYY";
sendVars.userObject = user; request.data=sendVars;
var _refUploadFile:FileReference=new FileReference();
_refUploadFile=obj.file;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS, onUploadProgress);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
_refUploadFile.upload(request, "file", true);
_refUploadFile.addEventListener(Event.COMPLETE, onUploadComplete);
From the services I tried returning a response object and the onUploadComplete method was never called, thought the file was uploaded successfully.So when you return a String from the service onUploadComplete method will be called.
Upvotes: 1
Reputation: 682
I would recommend running Wireshark from the client side to capture the network traffic as the file is attepted for upload. This should allow for an effective view of what the server is actually doing between the two installations.
Upvotes: 1