Dynamically update images on a server?

  • biggie
  • Novice
  • Novice
  • biggie
  • Posts: 18
  • Loc: UK

Post 3+ Months Ago

Hi,

Im using Flash MX and have a flash interface which is able to update & read text from a txt file using PHP.

Im now trying to enable this same interface to update images stored on my server named;

image1.jpg, image2.jpg & image3.jpg

I would prefferably like the user top be able to browse through thier local Hdd and select and image which is automatically uploaded to the server but dont think this is available in MX2004.

Another idea would be for the user to put all three images into a folder and manually upload the folder to the server, this however defeats the object of the interface as i wanted to eliminate manual updating.

Is there a way i can make this possible or any ideas on a better way around this?

Guidance is appreciated, thanks!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

u can browse & upload using html and php.
not sure though what u mean by updating an image. Is it .. replacing it?
  • biggie
  • Novice
  • Novice
  • biggie
  • Posts: 18
  • Loc: UK

Post 3+ Months Ago

Sorry for not being clear enough.

By updating i meant replacing it yes.

Currently the Banner.swf contains 3 images in /images/ folder, these are called into the swf dynamically using empty movieclips. The frontend.swf is used so that the user can upload thier own images to replace the 3 pictures in the /images/ folder.

Hope this clears it up.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

still, my answer is the same. Use html & php to upload.
File Upload ... you dont need flash for that (unless u have flash 8). From flash only use getURL function to call the html form used for upload.
  • biggie
  • Novice
  • Novice
  • biggie
  • Posts: 18
  • Loc: UK

Post 3+ Months Ago

thanks very much, ill take a look into that. sounds like it could be what i was looking for.
  • biggie
  • Novice
  • Novice
  • biggie
  • Posts: 18
  • Loc: UK

Post 3+ Months Ago

I may just be a little dim but i need help with the tutorial.

The second part where it says about the - move_uploaded_file Function

Im not too sure where to put this?

Ive left the code default to how it is in the tutorial and created a folder on my server called 'uploadedfile' but everytime i try and upload a file i receive the error - 'There was an error uploading the file, please try again!'

What could be the problem?

My uploader.php currently looks like this-

Code: [ Select ]
<?php

// Where the file is going to be placed
$target_path = "uploadedfile/";

/* Add the original filename to our target path.
Result is "uploadedfile/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name'];

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  echo "The file ". basename( $_FILES['uploadedfile']['name']).
  " has been uploaded";
} else{
  echo "There was an error uploading the file, please try again!";
}

?>
  1. <?php
  2. // Where the file is going to be placed
  3. $target_path = "uploadedfile/";
  4. /* Add the original filename to our target path.
  5. Result is "uploadedfile/filename.extension" */
  6. $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
  7. $_FILES['uploadedfile']['tmp_name'];
  8. $target_path = "uploads/";
  9. $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
  10. if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  11.   echo "The file ". basename( $_FILES['uploadedfile']['name']).
  12.   " has been uploaded";
  13. } else{
  14.   echo "There was an error uploading the file, please try again!";
  15. }
  16. ?>
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

didnt look over your code ... but first of all try to see if you grant permission to write in the folders where u want to upload.
If you`re in windows ... right click on the folder for upload, go to properties -> web sharing, and share the folder with read/write permission.
Also probably you`ll need to grant security access to the same folder, but do this if it doesnt work only with the Web Sharing. Folder Properties -> security -> Add -> Advanced -> Find -> search for Apache and then add it.

It might be possible that the script doesnt work, but try that first, and if it still doesnt work i`ll give u a working script.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.