|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
File Download Link Not Working!
Hello once again one and all,
Well Ive got the main part of my scripts sorted now. I will explain what I have done. Online Lecture Video Downloads 1. The user can use a form to enter details about lectures. The user can browse for a video file of the lecture to upload to the server. 2. The data is sent to mysql where it is stored. 3. The file is uploaded to a directory that I have set aside for such uploads (mysql stores the filePath in a field). 4. When students log onto the site, they are presented with a table including each lectures data, such as module code, title, week number, topics covered. There is also a link to download the file in the table. This is where I have a small problem. When a link is clicked that points to a file, the file will not download on my client pc; although it will open on \\localhost. Note I say ‘open’ not download(it opens the file in the application it is related to. Ie a realvideo file opens in real player, windows media file opens in media player. Etc) It is quite a big problem actually! Hear is the code anyway – if you can spot my problem I would be glad to hear from you. I have attatched the set of scripts and the database file if you wanna check out the whole thing (2 scripts, 1 form and database folder). I have included a small readme file as well to show you how to run it – very simple! Last edited by Gee : November 30th, 2002 at 09:08 PM. |
|
#2
|
|||
|
|||
|
Most filetypes these days are designed to do that, eg, open in the helper application. It may not be a problem with your scripts at all.
|
|
#3
|
|||
|
|||
|
It is definately a problem in my script cause when I test it on a client instead of //localhost it just will not download the file - here is the script anyways - please if anyone can help me on this one #I would be very grateful been trying for ages with no avail - somebody must know !
PHP Code:
|
|
#4
|
|||
|
|||
|
PHP Code:
What are those curled braces , eg "{" doing there? I wouldn't have put them in, but am I missing something? ![]() |
|
#5
|
|||
|
|||
|
Quote:
It's used so the array will work.. When using arrays in the middle of strings, all of the following are correct: echo "Here's the value: {$array['name']}" echo "Here's the value: $array[name]"; echo "Here's the value: " . $array['name']; the curly braces inside of string allows you to use arrays, access objects, etc like this: echo "Here's the value: {$obj->getName()}"; Here's the manual entry for it. Scroll down until you hit Complex (curly) syntax: http://www.php.net/manual/en/language.types.string.php
__________________
Best Regards, Håvard Lindset |
|
#6
|
|||
|
|||
|
I still cannot get the damn files to download - changed allsorts - spent many hours reading and debugging but no result.
I recon its something very simple cause the thing works on \\localhost but not on clients. Somebody, anybody. What about those that downloaded my scripts - did you have a look at them, did you spot anything? What do you think, any input at all to this problem is helpful. As you can probably tell - I am now desperate! |
|
#7
|
|||
|
|||
|
I just downloaded them now and will have a look. Oh, and side note to the mods/admin, can you install the quick reply hack to the board, it would make things so much easier...
|
|
#8
|
|||
|
|||
|
ThnX kanu,
I look forward to your input! |
|
#9
|
|||
|
|||
|
Right, running into the problems you describe... Hmm, can I ask a question? Why not use the database to store the file too? I mean, is there a particular reason for using disk storage? The BLOB Tutorial that we spoke about in the other thread could be very easily altered to do what you wish that way... I'm just not familiar with uploading to a file on a server as opposed to the BLOB method.
|
|
#10
|
|||
|
|||
|
Well kanu, I had intended to use blobs to store the files at first, but then after reading up on the subject I found that this can severely overload mysql and slow things down immensly when large files are stored as blobs. For this reason I decided to store files in a directory.
Its typical, I get everthing running perfectly - file uploads, database storage for the data, but when I get to the very last part - everything goes pear shaped! I couldnt get that blob tutorial to work anyway ( ) |
|
#11
|
|||
|
|||
|
One thing I have noticed is that when I change the following...
PHP Code:
To for instance... PHP Code:
And you click on the link to download the file in the browser - it includes the ipaddress followed by localhost followed by the filepath as the url - PHP Code:
very strange - I dont know why it is including both ipaddress and localhost - very strange?. |
|
#12
|
|||
|
|||
|
Quote:
![]() EDIT: Though it would be advantageous to have the actual BLOBs themselves in a seperate table if possible. Last edited by Kanu : December 1st, 2002 at 12:30 PM. |
|
#13
|
|||
|
|||
|
the thing is - i was wanting to get this working properly, you know when you sart something you wanna succeed.
I think I might as well just give up on a bad job! So close yet so far ![]() |
|
#14
|
|||
|
|||
|
Quote:
so how do you do that, i've been having major issues with it ![]()
__________________
Apache Expert |