Solved

Flash htaccess and loadsound

Posted on 2004-08-02
9
154 Views
Last Modified: 2010-04-03
I have this simple script:
url = "http://www.domain.com/file.mp3";
player2 = new Sound();
player2.loadSound(url, true);

but now my file.mp3 is behind a .htaccess and it require I send a user and password.. I see I can send the user and password from the header, but I don't realy understand how I can send a header with the loadsound... someone have any idea how I can send the user password for I can get the mp3?

0
Comment
Question by:Yard072999
  • 5
  • 4
9 Comments
 
LVL 6

Expert Comment

by:hsmtp
Comment Utility
Use it this way:

url = "http://login:password@www.domain.com/file.mp3";
player2 = new Sound();
player2.loadSound(url, true);
0
 
LVL 6

Expert Comment

by:hsmtp
Comment Utility
But anyone can decompile your movie and see your login and password.
0
 

Author Comment

by:Yard072999
Comment Utility
I already try, but it don't work it seem that only work for ftp and not for http...
0
 

Author Comment

by:Yard072999
Comment Utility
bah I don't care about that :), because the user will write his own user and password into a textbox in the flash...
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 6

Expert Comment

by:hsmtp
Comment Utility
If you have htaccess and modeRewrite available on your server, you may use URL rewrite from

http://www.domain.com/music/login/password/file.mp3

to

http://login:password@www.domain.com/file.mp3


Here is the rule for .htaccess:

RewriteRule      music/([^/]+)/([^/]+)/([^/]+)$      http://$1:$2@www.domain.com/$3
0
 
LVL 6

Expert Comment

by:hsmtp
Comment Utility
Don't forget to turn on mod_rewrite engine:

RewriteEngine      on
0
 
LVL 6

Accepted Solution

by:
hsmtp earned 500 total points
Comment Utility
Damn, looks like this rule will simply redirect you to needed location. It may not work.

Maybe you have some PHP language here? So you can write your own program for checking login and password and giving the file?
0
 

Author Comment

by:Yard072999
Comment Utility
hmm, don't work :), I think I will use php and send the username and password in the url like ww.domain.com/mp3.mp3?user=thing&pass=something... I think is the best way... I will leave this question open for some moment in case someone have any idea :) else I will give you the point the idea of php and loginpassword :)
0
 

Author Comment

by:Yard072999
Comment Utility
I think is the best solution for using the php script in this case.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now