bandit8 Posted February 12, 2008 Share Posted February 12, 2008 Hi, I have a Flash movie that allows a user to upload an image to a server, using a php script. Once uploaded, the file is then loaded into the Flash movie from the server so that it is displayed to he user. I had all of this working totally fine on a shared-hosting server I had been using... but I recently switched over to a dedicated-virtual server, and as soon as I did it stopped working! The progress bar shows that the file is being uploaded, but then 'hangs' at the end, and does nothing. Logging into the server via ftp, I can see that the file was indeed successfully uploaded, however it won't let me delete it off of the server (it says I don't have permission). Looking at the properties of the file on the server, it shows the user and group as 'apache', where as on the old server it showed the user as my ftp login, and allowed me to delete it. I can't figure out why it keeps 'hanging', and why the Flash movie won't load in the file. All of the Flash coding, and PHP settings (i.e. safe_mode, upload_max_filesize, etc.) all match the old server..so I'm stumped. The PHP code Flash ueses to upload the file is: <?php $folderName = $_GET[num]; //create the directory if doesn't exists (should have write permissons) if(!is_dir("pix/$folderName")) mkdir("pix/$folderName", 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], "pix/$folderName/".$_FILES['Filedata']['name']); chmod("pix/$folderName/".$_FILES['Filedata']['name'], 0777); ?> Any suggestions/ideas would be greatly appreciated. If you need clarification of anything, please just let me know. Thanks! -b. Quote Link to comment https://forums.phpfreaks.com/topic/90691-php5-file-upload-to-linux-server/ Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 You need to make sure your server root is writtable by the apache user. I would also join the apache group, this should enable you to delete these files via ftp. Is this a managed vps? If not, you really ought to get to know some server admin. Quote Link to comment https://forums.phpfreaks.com/topic/90691-php5-file-upload-to-linux-server/#findComment-464875 Share on other sites More sharing options...
bandit8 Posted February 12, 2008 Author Share Posted February 12, 2008 You need to make sure your server root is writtable by the apache user. I would also join the apache group, this should enable you to delete these files via ftp. Is this a managed vps? If not, you really ought to get to know some server admin. Hi thorpe, thanks for your reply. I have a complete control over the server...but will openly admit I know very little about servers, or apache! How would I go about ensuring that the server root is writtable by the apache user? Thanks for any further suggestions you can provide. -b. Quote Link to comment https://forums.phpfreaks.com/topic/90691-php5-file-upload-to-linux-server/#findComment-464957 Share on other sites More sharing options...
bandit8 Posted February 12, 2008 Author Share Posted February 12, 2008 p.s. I had a colleague who knows a lot more about linux/vim editing then me play around with it yesterday, and he added my ftp user as part of the apache group...but was baffled by how it still wouldn't let me delete....or what could be causing this problem in general. Quote Link to comment https://forums.phpfreaks.com/topic/90691-php5-file-upload-to-linux-server/#findComment-464960 Share on other sites More sharing options...
trq Posted February 12, 2008 Share Posted February 12, 2008 What are the permissions on the pix directory? Quote Link to comment https://forums.phpfreaks.com/topic/90691-php5-file-upload-to-linux-server/#findComment-464964 Share on other sites More sharing options...
bandit8 Posted February 12, 2008 Author Share Posted February 12, 2008 What are the permissions on the pix directory? The permissions are 777 ... that was one of the first things I checked (I had been hoping it would be something that simple!)... so that can't be affecting Flash's ability to read in the image... Quote Link to comment https://forums.phpfreaks.com/topic/90691-php5-file-upload-to-linux-server/#findComment-465184 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.