The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 6 of 6

Thread: Uploading flash files via php/mysql

  1. #1

    Uploading flash files via php/mysql

    Hi all, I searched the forum first before posting, and I didnt find anything related so if my question has already been answered sorry! Ok so I am working on a demo CMS and I am trying to have a banners panel where admins can upload banners... Of course I can already handle upload and insertion of images into mysql via php, but, how do I do the same for flash files and not gifs or jpegs (if they try to upload flash banners)? What are the differences, if any, and, is there some kind of tutorial for this?

    Thank you very much

    Ted

  2. #2
    Quote Originally Posted by tedc
    Hi all, I searched the forum first before posting, and I didnt find anything related so if my question has already been answered sorry! Ok so I am working on a demo CMS and I am trying to have a banners panel where admins can upload banners... Of course I can already handle upload and insertion of images into mysql via php, but, how do I do the same for flash files and not gifs or jpegs (if they try to upload flash banners)? What are the differences, if any, and, is there some kind of tutorial for this?

    Thank you very much

    Ted
    Hi,

    I am not sure if I understand you right... but what I understand is that you want to upload .swf file in the same way as .gif or .jpg files.. but .swf don't work the same as .gif and .jpg file (with <img> tag I mean).
    If this is your problem, then I would do like this...

    1. Add a extra field in you table where you save the addresses to the banner named "ban_type" or something like that.

    2. When uploading a file, check what kind of file it is.

    3. If the kind of the file is a image (like GIF or JPEG), add the value "1" to "ban_type". If it is flash, add the value "2" to "ban_type".

    4. On the page where the banner is shown, check "ban_type". If this is set to "1", then use "<img border=0 src="$img_addr">", if its set to "2" use "<object classid.....></object>"


    I hope I helped you.

    Best regards,
    Paul Peelen

  3. #3
    Quote Originally Posted by Tvirus
    I hope I helped you.
    Yes it did, I just needed some orientation as I havent done anything like that before and I didnt know if there are some special instructions for flash or anything like that, in fact it hadnt even occured to me that the problem is that it is not displayed with the same tag, I was only thinking about the uploading, which is apparently the same as any other file, but yes, it all seems very easy and logical! Thank you!! -tonight

    Ted

  4. #4
    uhhh I just realized that icon looks weird ha... I meant that I'll be up all night working on this, not something else...

    Ted

  5. #5
    Quote Originally Posted by tedc
    uhhh I just realized that icon looks weird ha... I meant that I'll be up all night working on this, not something else...

    Ted
    Okej... NP.
    You know where to find me if you need any help.

    // Paul

  6. #6
    Another way to do it would be to load the source of the file from the database and then check the last 4 digits, if it is an swf use embed, otherwise use img.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012